babel-esm-plugin
babel-esm-plugin copied to clipboard
Doesn't seem to exclude externals from bundle
I use https://github.com/liady/webpack-node-externals to handle externals and cjs is ok, but esm include all of external dependencies. Maybe I did something wrong?
Can u give us a sample repo? It'll be extremely helpful
Looks like https://github.com/webpack-contrib/worker-loader/issues/95#issuecomment-352856617 related @prateekbh please look at comment
oh yes that absolutely seems to be the root cause. I'll try to fix this.
Disclaimer: My free time during the pandemic is running seriously low. PRs are always welcome and will be reviewed at priority
could there be a workaround for this issue?
Adding the externalPlugin to this source code would be fix i guess
Yeah, the quick fix is (in src/index.js
of this plugin):
const { ExternalsPlugin } = require('webpack');
// ....
if (compiler.options.externals) {
new ExternalsPlugin('module', compiler.options.externals).apply(childCompiler);
}