I have enabled JS minification and Merging while in developer mode. Then i enabled production mode.
Cleared cache and ran below commands:
php bin/magento setup:upgrade
php bin/magento indexer:reindex
php bin/magento setup:di:compile
php bin/magento setup:static-content:deploy
but still i get 404 error for all JS files in console.
Magento still tries to look for Non-minified version of JS files!
Note: In developer mode everything works fine!
1 Answer 1
I fixed this by editing .htaccess file in /pub/static
uncommented line 16 so it looks like this
RewriteBase /pub/static/
I then ran
bin/magento deploy:mode:set production
again and it cleared the errors.
All js and css are minified and merged correctly
Explore related questions
See similar questions with these tags.