Feature request from markoshust, posted on GitHub Sep 07, 2015
There is a flag on the ./bin/magento module:enable command: --clear-static-content
Unfortunately, this only appears to be on the module-enable option. If static assets are desired to be cleared at any other time, this isn't an option.
I believe there should be a new command under ./bin/magento that just clears this static content, something like:
I'm not sure if static assets are considered a cached asset, so this may need some revision.
Comment from xcomSteveJohnson, posted on GitHub Sep 07, 2015
Fair point. There is one other time that static view files are cleared: switching from developer <> production modes.
Comment from godban, posted on GitHub Sep 08, 2015
@MarkShust there is grunt clean, maybe would be helpful
Comment from alankent, posted on GitHub Sep 08, 2015
We need this separation potentially for automated deployment pipelines. Grunt might be a short term workaround, but must not be mandatory for that (e.g. switching from dev to prod mode). We should have a separate magento command if its needed. We have been introducing these CLI commands to avoid "oh, for use case X remove directory Y" - we want it to be "for use case X run command Y" so if we change things internally related to "use case X", we can adjust "command Y" to follow the new rules without breaking existing deployment pipelines.
Comment from Desmaster, posted on GitHub May 02, 2016
Really missing this feature as well, people shouldn't be removing directories when deploying..
Thinking about creating my own pull request to get it on the rails asap.
Comment from mbrinton01, posted on GitHub Aug 18, 2016
Created internal issue MAGETWO-57193 to track this suggestion