Closed chingyawhao closed 4 years ago
What would be required to make that work? I guess we should allow webpack plugins to be passed to new ThreadsPlugin()
, so that they will be applied when bundling the workers (as a webpack child compiler is created to compile the workers, it's not the same instance that compiles the main thread source files).
I'm able to achieve what I wanted using webpack2-externals-plugin
and passing it to ThreadsPlugin
new ThreadsPlugin({
plugins: [
new ExternalsPlugin({
type: 'commonjs',
include: __dirname + '/node_modules',
})
]
})
I was looking for a solution to allow me to use
webpack-node-externals
for threads too Some of the dependencies I used cannot be compiled by webpack