Skip to content

Add option to skip overriding assets: tasks #440

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

Closed
mipearson opened this issue May 29, 2017 · 3 comments
Closed

Add option to skip overriding assets: tasks #440

mipearson opened this issue May 29, 2017 · 3 comments

Comments

@mipearson
Copy link

Hi,

I'm looking at moving our application off of my gem webpack-rails and on to webpacker and also writing a guide for others to do so, with the intention of sunsetting webpack-rails.

Our application builds the sprockets assets and webpack assets separately. By doing so, we can do some clever caching to avoid having to build our webpack assets (which takes ~40s in CI) on every CI build. I'd like to preserve this behaviour.

I'd like to submit a pull request to add an option to config/webpacker.yml that disables the Rake::Task[*].enhance calls in webpacker.

Would this be acceptable?

@mipearson
Copy link
Author

Really janky, hopefully temporary workaround:

%w{assets:clobber assets:precompile}.each do |task_name|
  Rake::Task[task_name].instance_eval do
    @actions.reject! { |action| action.source_location[0] =~ /webpacker/ }
  end
end

@ytbryan
Copy link
Contributor

ytbryan commented May 31, 2017

I think you should write that PR. Thanks for taking time to look at this.

@gauravtiwari
Copy link
Member

@mipearson Feel free to make a PR when you get a chance and we can take look together 👍

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

No branches or pull requests

3 participants