I have enabled merging for javascript and css from my magento 2 store admin panel. But I can still see all the css coming unmerged in my view source. Javascript merge is working fine and coming merged. Any help here would be appreciated.

I have already set magento to production mode.

enter image description here

enter image description here

  • Did u run setup:upgrade and setup:static-content:deploy commands after enabling merging in Admin? – Sejal Shah Aug 1 '17 at 7:54
  • Yes. multiple times. – vibhu Aug 1 '17 at 7:56

My first port of call would be to delete pub/static/frontend/ and var/view_preprocessed and then clear all caches (Magento and browser cache).


Delete pub/static/ and var/view_preprocessed manually and then run content:deploy command.

It should work.

Note: Make sure you are on Production mode.

  • 1
    I wouldn't recommend deleting pub/static, doing so will remove .htaccess which can cause issues. – Ben Crook Aug 1 '17 at 12:09
  • Yes. You have to keep .htaccess and remove other content. – Sejal Shah Aug 1 '17 at 12:13

I found the issue. A Third part plugin css was creating the issue. It was not getting minified as well. Commenting it from the xml did the trick.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.