Why we write this guide There are several reasons
The official guide provides very little info.
We underestimated the effort to do this. This long post explains our similar experience.
Yet, that long post doesn't give a brief step-by-step guide. So, we decide to fill the gap.
1. Add Webpacker to Gemfile We recommend you to leave the sprockets gem in your Gemfile if it's still needed. Or, if you plan to move gradually. Don't worry because both of them won't interfere with each other. In our project, we do use both because we can't migrate all the javascript libs we use for various reasons we can't disclose. At the last of this step, make sure you've run the bundle install command. 2. Configure the webpacker gem There are many configurations on the webpacker documentation. Here, we'll focus on these three, to make you easier to start:
config/webpack/loader/custom_loader.js
config/webpack/loader/erb.js
config/webpack/production.js
Let's start with custom_loader.js. In this file, we use…
Score: 1.32
Privacy settings changed!
Article is saved. Do you want to continue editing the article or leave and edit later?