Missing CSS and JS files In magento2 Git Repository
The repo is up to date.
Here is how the resources in pub/static should work.
The meaning of "module" changed in magento 2. Now the files are not separated between code, template and skin. Everything goes in the same module Vendor_Module
.
When requesting a resource from pub/static
, if the file does not exist the request is rewritten to ../static.php?resource={resource name here}
.
Take a look at the .htaccess
file in the pub/static folder to understand better.
You get 404 responses probably because you don't have mod_rewrite
enabled.
You should enable it.
But it can work without it.
There is a 'cache' system for these static resources.
navigate to the folder dev/tools/Magento/Tools/View
and run this in the command line
php deploy.php
[EDIT]
In the later versions there is no more dev/tools/Magento/Tools/View
folder.
You can get the same effect by running this command:
php bin/magento setup:static-content:deploy
[/EDIT]
This will copy the static resources from each module to the pub/static
folder.
Be patient, it will take a while.
Remember this for the future. It is recommended to do this on the live server. It will speed up the access to static resources.
But there is a catch.
If you modify one of the static resources inside a module, the changes will not be available until you run php deploy.php
again.
And you should never modify any file from pub/static
directly. The changes will be overwritten the next time your execute deploy.php
.