Updated: Using Rails with Webpack: First steps
We now use webpacker 3.3.1 with rails/webpacker@^3.3.1 (resolves to webpack "^3.10.0"). This enables yarn integrity, so our modules should not become outdated. Also we adjusted https://makandracards.com/makandra/46247-how-to-make-webpacker-compile-once-for-parallel-tests-and-only-if-necessary to prevent an outdated cache.
Caveat: If your
yarn.lock changes (e.g. you checkout a previous commit or a commit from a colleague) you need to run manually
yarn and restart you
webpack-dev-server. Otherwise the outdated versions in your
node_modules folder are used.
Not yet solved
Changing the version of a package and restarting the
webpack-dev-server does not affect the test. The test still uses outdated files from
public/packs-test. Removing the folder manually triggers the tests to recompile the assets.
This is the message you see, when tests recompiling the assets.
Webpacker is installed 🎉 🍰 Using /home/username/Projects/projectname/config/webpacker.yml file for setting up webpack paths [Webpacker] Compiling assets 🎉