do not bundle es module multiple times

This commit is contained in:
Yanzhen Yu
2026-04-01 12:00:00 +08:00
parent 8f57ba9808
commit bd89778315

View File

@@ -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,6 +148,7 @@ for (const c of baseConfigs) {
}, },
], ],
}); });
if (c.esm) {
// ES module // ES module
configs.push({ configs.push({
input: c.input, input: c.input,
@@ -159,6 +162,7 @@ for (const c of baseConfigs) {
}, },
], ],
}); });
}
} }
if (process.env.BROWSER_ONLY) { if (process.env.BROWSER_ONLY) {