This fixes an issue where constructing Workers in Webpack's strict mode (javascript/esm) would throw an exception during bundling due to the generated require() statement.
Fixing this required reaching into Webpack internals, and I couldn't find any better way to do it. On the plus side, the output is much nicer and supports module concatenation (new Worker(m.p+"0.worker.js")).
This fixes an issue where constructing Workers in Webpack's strict mode (
javascript/esm
) would throw an exception during bundling due to the generated require() statement.Fixing this required reaching into Webpack internals, and I couldn't find any better way to do it. On the plus side, the output is much nicer and supports module concatenation (
new Worker(m.p+"0.worker.js")
).Fixes #38 🎉