2

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

1
  • 1
    It is never safe to run rm -rf whatever/* in root. You never know what might happen. Commented Apr 11, 2016 at 13:44

1 Answer 1

0

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.

4
  • 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. Commented Apr 17, 2016 at 9:21
  • @TimondeGroot and how do you do that with a magento command? Commented Apr 17, 2016 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. Commented May 3, 2016 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! Commented May 5, 2016 at 14:35

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.