Updated: How to make Webpacker compile once for parallel tests, and only if necessary

The solution was rewritten to be more robust:

  • Fix "ChunkLoadError: Error loading chunk 0" in parallel tests runs (affected apps that have a config.asset_host)
  • Prevent RSpec from compiling packs once for each test process when calling specs without a local webpack-dev-server
  • Don't freeze the parallel tests suite if the first test process crashes during compilation
  • Prevent making a trillion SHA1 hashes over the file contents of every file in app/ during tests
  • Remove duplicate digest logic already implemented in Webpacker itself
  • Also recompile when files in config/webpacker changed (use Webpacker's logic)
  • Fix a bug where multiple packs would be created after the user deleted public/packs-test (to remove a cached build).
Henning Koch about 1 month ago
This website uses short-lived cookies to improve usability.
Accept or learn more