Magento – Magento 2 setup:staitic-content:deploy doesn’t update css

magento2static-content-deploy

I'm running Magento 2 in production mode.

I made some changes in my theme's css files.

I try to make the css change reflecting on the live site, by using following command.

php bin/magento setup:static-content:deploy en_AU en_US

I can't see the css files are updated in pub/static folder.

I have flushed cache php bin/magento cache:flush before and after static-content deploy.

Did i miss any steps?


Update,

By removing everything from the pub/static/frontend folder, then deploy static-content will make css changes reflecting on the site. But this will break site for a few moment. There's no way to implement css / js changes in a product mode without breaking the site?

Best Answer

Run orders in the following order:

rm -Rf var/view_preprocessed/* var/*cache/* pub/static/frontend/*
php bin/magento setup:static-content:deploy
php bin/magento cache:flush --all

In production mode, you have a CSS and JS files cache, this cache is must remove after that is must refresh cache, screen.

Related Topic