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.
-
Did u run setup:upgrade and setup:static-content:deploy commands after enabling merging in Admin?Sejal Shah– Sejal Shah2017年08月01日 07:54:36 +00:00Commented Aug 1, 2017 at 7:54
-
Yes. multiple times.vibhu– vibhu2017年08月01日 07:56:43 +00:00Commented Aug 1, 2017 at 7:56
3 Answers 3
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.
-
1I wouldn't recommend deleting
pub/static, doing so will remove.htaccesswhich can cause issues.Ben Crook– Ben Crook2017年08月01日 12:09:14 +00:00Commented Aug 1, 2017 at 12:09 -
Yes. You have to keep .htaccess and remove other content.Sejal Shah– Sejal Shah2017年08月01日 12:13:26 +00:00Commented Aug 1, 2017 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.
Explore related questions
See similar questions with these tags.