We are making style changes while working in developer mode.

Then we push the files to our server which is in production.

Then we run $ magento setup:static-content:deploy en_GB

but the changes aren't showing.

If we first delete folders in pub/static and then run $ magento setup:static-content:deploy en_GB then the changes are showing up.

What command can we run on our production server to first clean the pub/static folder? I don't think it is safe to run rm -rf pub/static/* every time we push to production

  • It is never safe to run rm -rf whatever/* in root. You never know what might happen. – Julien Lachal Apr 11 '16 at 13:44

I've found out that if you run

php bin/magento cache:flush
grunt clean

first and then

magento setup:static-content:deploy en_GB 

it will work, but that's not ideal, as you don't need grunt on your production server.

I would prefer a magento command if someone can post an answer.

  • grunt clean removes the pub/static/contents as well, so there's no difference in there. You should just remove pub/static/Vendor/Theme/ if you only want to see your theme's changes. – Timon de Groot Apr 17 '16 at 9:21
  • @TimondeGroot and how do you do that with a magento command? – Claudiu Creanga Apr 17 '16 at 12:07
  • There's no magento command for that. Keep in mind that grunt probably isn't installed on production. That's why you'd be better off with a simple rm -rf pub/static/*/ for now. – Timon de Groot May 3 '16 at 20:53
  • @TimondeGroot that's not an option for automatic deployment, but if there is nothing better, I prefer having grunt on production then. Thanks! – Claudiu Creanga May 5 '16 at 14:35

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.