Posted 2 months ago. Visible to the public. Deprecated. Auto-destruct in 24 days

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.

Copy
Webpacker is installed ๐ŸŽ‰ ๐Ÿฐ Using /home/username/Projects/projectname/config/webpacker.yml file for setting up webpack paths [Webpacker] Compiling assets ๐ŸŽ‰
Growing Rails Applications in Practice
Check out our new e-book:
Learn to structure large Ruby on Rails codebases with the tools you already know and love.

Author of this card:

Avatar
Emanuel De
Last edit:
2 months ago
by Emanuel De
About this deck:
We are makandra and do test-driven, agile Ruby on Rails software development.
License for source code
Posted by Emanuel De to makandra dev