When I run bin/magento setup:static-content:deploy it does not overwrite existing files but leaves them intact.

This leads to the unpleasant situation that I have to clear static file before I regenerate them. In the meantime my store is unaccessible. It would be so much easier if the files would remain in place and then just overwritten when the new file comes in.

Does anyone have a working solution for this?


Delete from you root directory :


Please run below commands:

bin/magento setup:static-content:deploy
bin/magento setup:upgrade
bin/magento c:c
bin/magento c:f
|improve this answer|||||
  • How does this relate to the question? – skymeissner Jun 4 '18 at 9:34

Alas, there always is way around... Here it is to use more than one locale. Magento indeed does not overwrite files if they exist, so you have to delete files before re-generating them. BUT if you generate files for more than one locale magento copies the files afterwards and overwrites exisiting files.

I use en_US and de_DE locales so I can do:

rm -rf pub/static/adminhtm/Magento/backend/es_ES; bin/magento setup:static-content:deploy es_US de_DE --area=adminhtml

to first clear all (unused) files in es_ES directory, generate them again and then have them copied very fast to the directories I need them in.

|improve this answer|||||

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.