sysgears / mochapack

Mocha test runner with integrated webpack precompiler
https://sysgears.github.io/mochapack/
MIT License
183 stars 27 forks source link

Caching build #118

Open ArtemMiller opened 2 years ago

ArtemMiller commented 2 years ago

webpack 5 has a file cache. I wish mochapack would use it.

Now it turns out that the build server spends 160 seconds building, and the tests themselves run 5 seconds.

the next time, he collects everything again and spends + - the same amount of war. When, could collect only changed files

215699p commented 2 years ago

Adding my 2c.

We use vue-test-utils which uses mochapack under the hood.

In our CI environment, we run our unit tests which involves mochapack compiling our sources before the tests run - we see a similar balance between compile & test times as the comment above.

There's currently no way to cache these compiled sources between runs or even locally.

Ideally, we would like to be able to compile with one npm script (maybe a flag on mochapack?), and test with another - this would allow us to cache the output of the compilation in a docker layer, greatly speeding up our CI & local development!

Thanks!