Magento2 Minified JS/CSS Issue – Minified Files Not Generated in pub/static

magento2minify

When enabling minify js and minify css within admin my storefront breaks. The markup is trying to call the minified files however these are not generated causing a lot of not found errors in browser console.

The store is in production mode and I have tried deploying static content and flushing all caches.

This is only an issue on the second store front however and the other seems to work perfectly with all js / css merged and minified correctly and generated within pub/static. For the second store front only non minified files seem to be present.

Best Answer

Following these steps in the following order fixed the issue for me:

1. Run Setup Upgrade

bin/magento setup:upgrade

2. Run Compilation

bin/magento setup:di:compile

3. Deploy static content

bin/magento setup:static-content:deploy en_GB

Related Topic