marvinhagemeister / karma-esbuild

Preprocessor based on esbuild for the karma test runner
MIT License
21 stars 10 forks source link

Build full test suite into a single bundle #11

Closed jridgewell closed 3 years ago

jridgewell commented 3 years ago

For larger projects, having each test file compile its own copy of the entire codebase leads to gigantic builds (AMP reached 20+ GB before my computer killed the process). This is because we treated each file as its own distinct entryPoint.

Instead, this creates a single bundle file that imports each test file, and has esbuild build that file. This leads to a single copy of the code base, and considerably smaller builds.

jridgewell commented 3 years ago

This should wait for #12 before we merge, so I can ensure the test suite passes on all OSs.

jridgewell commented 3 years ago

I had to include #13 in this PR to get the tests to consistently pass. You can see a diff by going to https://github.com/jridgewell/karma-esbuild/compare/karma-jsdom-launcher...single-bundle.