How to make Webpacker compile once for parallel tests, and only if necessary
Webpack is the future. We're using it in our latest Rails applications.
For tests, we want to compile assets like for production.
For parallel tests, we want to avoid 8 workers compiling the same files at the same time.
When assets did not change, we do not want to spend time compiling them.
Here is our solution for all that.
Its concept should work for all test suites. For Cucumber integration tests, place the following into
That's it. Enjoy! 🎉
Similar scenario: running an application with Webpacker on multiple servers. How to serve identical assets from all servers.