codymikol / karma-webpack

Karma webpack Middleware
MIT License
829 stars 220 forks source link

Webpack `optimization` configuration is not supported anymore #587

Closed BenoitZugmeyer closed 5 months ago

BenoitZugmeyer commented 5 months ago

Before v5, karma-webpack built one independent bundle per spec file that included every spec dependencies.

With v5.0.0, the new behavior is to use a single common chunk that includes all the code (source and spec). We were able to roll back to the previous behavior by leveraging the optimization webpack option (see code).

With v5.0.1, it is now forbidden to set the optimization webpack option (see https://github.com/codymikol/karma-webpack/commit/f2327b15bffd570a6d78703c5b65eb5a82f62b13), so our workaround does not work anymore, and upgrading to v5.0.1 breaks our test suite.

Expected Behavior

karma-webpack v5.0.1 should not introduce a breaking change and should still support the optimization webpack option. As an alternative, karma-webpack could introduce an option to restore pre-v5 behavior (one independent bundle per spec file).

Actual Behavior

karma-webpack v5.0.1 does not support the optimization webpack option.

How Do We Reproduce?

git clone https://github.com/DataDog/browser-sdk/
yarn
yarn add -D karma-webpack@5.0.1
yarn test
dlarocque commented 1 month ago

Hi @codymikol, we were happy to see 5.0.1 released, and wanted to upgrade in the Firebase JS SDK so that we can remove our usage of patch-package to patch in our fix (https://github.com/codymikol/karma-webpack/commit/f734b109c7c970bf775c71553343ed8069899ed2) from a few years ago onto 5.0.0. It turns out we relied on setting optimization configurations, so upgrading to 5.0.1 is breaking for us.

When can we expect this fix to be released?

codymikol commented 1 month ago

I'll cut a release this weekend

dlarocque commented 1 month ago

I'll cut a release this weekend

That's great news for us, thank you!!