trivago / parallel-webpack

Builds multi-config webpack projects in parallel
BSD 3-Clause "New" or "Revised" License
1.48k stars 96 forks source link

Expose compiler plugin API #82

Open sberney opened 6 years ago

sberney commented 6 years ago

Explain the problem

I use karma-webpack for testing, and there is no karma-parallel-webpack plugin. My code gets built three times -- during build (using parallel-webpack), and twice more for two test suites. I can't (easily) write a karma-parallel-webpack plugin, because parallel-webpack doesn't expose the compiler/compiler.plugin API that karma-webpack relies on.

What is involved in exposing this API? It seems like it would involve lots of message-passing.

pago commented 6 years ago

I think it'd slow down parallel-webpack so much that any potential speed gain would be lost immediately. The reason for that is that each build is run in a separate processes so we'd need to do a lot of cross-process communication - during the build. That certainly won't be fast.

Please note that parallel-webpack is not meant to be used in all situations. At trivago, we're only using it for production builds. Tests and development builds are not using it (we avoid the many variants in those cases).