I tried webpacker in a project, and now I want to disable or remove the webpacker from it decently, but I failed to find how to in Docs and searching, and also there isn't a Rake task defined for this.
So some help will be appreciated.
Updated:
Sometimes, you will need to disable things in order to successfully debug or test other things.
Disabling webpacker
#gem 'webpacker'
Remember to run bundle install
app/config/development.rb
# config.webpacker.check_yarn_integrity = false
app/config/production.rb
# config.webpacker.check_yarn_integrity = false
app/views/*
<%# javascript_pack_tag "" %>
<%# stylesheet_pack_tag "" %>
Update1: *I’m typing this on a phone and no access to laptop till night time. Will provide code snippet when I’m back
Feel free to add to the comments if I miss out anything.
@ytbryan Thanks for your rapid helping~
I commented out these lines, and the webpacker did not run compiling again when I run rails assets:precompile. But I found Rails still execute yarn install.
I'm not clear that if it's a feature of Rails 5 or because that webpacker hooks up a new webpacker:compile task to assets:precompile as documented here. If it was because of the later, how do I unhook it?
Thanks again ~
🤔 to give you an accurate answer, I need to trace the source code when I get back.
But at the back of my mind, I think you can:
@ytbryan yes, it works. Thanks again~
Most helpful comment
Updated:
Sometimes, you will need to disable things in order to successfully debug or test other things.
Disabling webpacker
Remember to run
bundle installapp/config/development.rbapp/config/production.rbapp/views/*Update1: *I’m typing this on a phone and no access to laptop till night time. Will provide code snippet when I’m back
Feel free to add to the comments if I miss out anything.