I'm building a library with lerna + rollup and i want to create the .min file (which includes all dependencies within the library) starting from the main package, but after running it with the followings configs, i receive async_hooks is not defined within the browser.
These are my configs:
{
input: 'src/index.js',
output: {
file: '../../dist/bundle.min.js',
format: 'iife',
sourceMap: 'inline'
},
plugins: [
babel({
exclude: /node_modules/,
babelrc: false,
babelHelpers: 'runtime',
extensions: ['.mjs', '.js', '.json', '.node'],
presets: [
[
'@babel/preset-env'
]
],
plugins: [
'@babel/plugin-proposal-export-default-from',
'@babel/plugin-proposal-export-namespace-from',
['@babel/plugin-transform-runtime', {
'helpers': true,
'regenerator': true
}]
]
}),
resolve({
extensions: ['.mjs', '.js', '.json', '.node'],
}),
commonjs({
include: /node_modules/,
browser: true,
}),
json(),
globals(),
builtins(),
terser()
]
}