do not bundle es module multiple times
This commit is contained in:
@@ -80,7 +80,9 @@ const baseConfigs = [
|
|||||||
input: './src/entries/all.ts',
|
input: './src/entries/all.ts',
|
||||||
name: 'rrweb',
|
name: 'rrweb',
|
||||||
pathFn: toAllPath,
|
pathFn: toAllPath,
|
||||||
|
esm: true,
|
||||||
},
|
},
|
||||||
|
// plugins
|
||||||
{
|
{
|
||||||
input: './src/plugins/console/record/index.ts',
|
input: './src/plugins/console/record/index.ts',
|
||||||
name: 'rrwebConsoleRecord',
|
name: 'rrwebConsoleRecord',
|
||||||
@@ -146,19 +148,21 @@ for (const c of baseConfigs) {
|
|||||||
},
|
},
|
||||||
],
|
],
|
||||||
});
|
});
|
||||||
// ES module
|
if (c.esm) {
|
||||||
configs.push({
|
// ES module
|
||||||
input: c.input,
|
configs.push({
|
||||||
plugins,
|
input: c.input,
|
||||||
preserveModules: true,
|
plugins,
|
||||||
output: [
|
preserveModules: true,
|
||||||
{
|
output: [
|
||||||
format: 'esm',
|
{
|
||||||
dir: 'es/rrweb',
|
format: 'esm',
|
||||||
plugins: [renameNodeModules('ext')],
|
dir: 'es/rrweb',
|
||||||
},
|
plugins: [renameNodeModules('ext')],
|
||||||
],
|
},
|
||||||
});
|
],
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (process.env.BROWSER_ONLY) {
|
if (process.env.BROWSER_ONLY) {
|
||||||
|
|||||||
Reference in New Issue
Block a user