shakacode / shakapacker

Use Webpack to manage app-like JavaScript modules in Rails
MIT License
417 stars 91 forks source link

Clean output directory by default? #492

Open justin808 opened 3 months ago

justin808 commented 3 months ago

Should bin/shakapacker and bin/shakapacker-dev-server clean the output directory when starting? should this be configurable in the shakapacker.yml file?

I see startup scripts like:

rm -rf public/packs/* && bundle exec rake react_on_rails:generate_packs && foreman start -f Procfile.dev

While this cleaning is not needed for docker builds, I don't see any harm.

Related to #491

tomdracz commented 3 months ago

IMO no. If one wants to clean up the compiled assets we have both clean and clobber tasks that can be used directly or enhancing the compile task.

From principle of least surprise standpoint, compilation or dev server having side effect of cleaning old assets, doesn't sit well with me also.

Are there any specific use cases where cleaning the output is really required? Don't think I've encountered many bar switching CDN config etc maybe.