Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add equivalent task to "rake assets:clean" #1410

Closed
swrobel opened this issue Apr 5, 2018 · 15 comments · Fixed by #1744
Closed

Add equivalent task to "rake assets:clean" #1410

swrobel opened this issue Apr 5, 2018 · 15 comments · Fixed by #1744

Comments

@swrobel
Copy link
Contributor

swrobel commented Apr 5, 2018

I don't see any straightforward way to remove all of the outdated packs from public/packs[-test] ... am I missing something?

@gauravtiwari
Copy link
Member

@swrobel There is one to remove everything:

bundle exec rails webpacker:clobber
# env aware
RAILS_ENV=test bundle exec rails webpacker:clobber

@swrobel
Copy link
Contributor Author

swrobel commented Apr 7, 2018

Thanks, I'm aware of that one, but that's like assets:clobber, not assets:clean.

@ytbryan
Copy link
Contributor

ytbryan commented Apr 7, 2018

I think we will need an “assets clean” that act on webpacker’s assets

@swrobel swrobel changed the title Equivalent task to "rake assets:clean" ? Add equivalent task to "rake assets:clean" Apr 10, 2018
@swrobel
Copy link
Contributor Author

swrobel commented Apr 13, 2018

For context, Heroku's ruby buildpack depends on assets:clean to make sure slug sizes don't get too big. https://github.com/heroku/heroku-buildpack-ruby/blob/v177/lib/language_pack/rails4.rb#L92

cc @schneems

@martron
Copy link

martron commented May 17, 2018

+1 to this. Our deploy script compiles assets locally and to save time not re-compiling everything we use assets:clean instead of clobber.

@investment-radar
Copy link

And for me another thing I want just like assets:clean, by default it will keep 3 versions of the assets files.

@swrobel
Copy link
Contributor Author

swrobel commented Oct 11, 2018

possible solution: heroku/heroku-buildpack-ruby#803 (comment)

@ericboehs
Copy link
Contributor

I've started on a solution here: master...ericboehs:eb-4-clean-task

@ytbryan
Copy link
Contributor

ytbryan commented Oct 11, 2018

looking good! Send a PR!

@ericboehs
Copy link
Contributor

I don't think it's ready. I believe it needs to keep recent versions of the assets or active user sessions will break after a deploy.

@ericboehs
Copy link
Contributor

ericboehs commented Oct 11, 2018

It's ready. Or as close to ready as I'm going to get it without some input. cc: @ytbryan @swrobel

Edit: If someone wants to try it on Webpacker 3 (or 4), I made a monkey patch: https://gist.github.com/7121c96eab1d1041b8a7000ed2418e7c.

@phlegx
Copy link

phlegx commented Dec 11, 2018

Are there any news regarding this? Would be really helpful!

@NielsKSchjoedt
Copy link

+1

1 similar comment
@henrypoydar
Copy link

+1

@NielsKSchjoedt
Copy link

Looks like there as a cleanup plugin introduced for Webpacker itself, I added this, and it works great! It's a more integrated way of cleaning up those assets instead of relying on rails doing it. https://github.com/johnagan/clean-webpack-plugin

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

9 participants