@@ -162,27 +162,46 @@ for (const c of baseConfigs) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (process.env.BROWSER_ONLY) {
|
if (process.env.BROWSER_ONLY) {
|
||||||
configs = {
|
const browserOnlyBaseConfigs = [
|
||||||
input: './src/index.ts',
|
{
|
||||||
plugins: [
|
input: './src/index.ts',
|
||||||
|
name: 'rrweb',
|
||||||
|
pathFn: (p) => p,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
input: './src/plugins/console/record/index.ts',
|
||||||
|
name: 'rrwebConsoleRecord',
|
||||||
|
pathFn: toPluginPath('console', 'record'),
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
|
configs = [];
|
||||||
|
|
||||||
|
for (const c of browserOnlyBaseConfigs) {
|
||||||
|
const plugins = [
|
||||||
resolve({ browser: true }),
|
resolve({ browser: true }),
|
||||||
typescript(),
|
typescript(),
|
||||||
postcss({
|
postcss({
|
||||||
extract: true,
|
extract: false,
|
||||||
minimize: true,
|
inject: false,
|
||||||
sourceMap: true,
|
sourceMap: true,
|
||||||
}),
|
}),
|
||||||
terser(),
|
terser(),
|
||||||
],
|
];
|
||||||
output: [
|
|
||||||
{
|
configs.push({
|
||||||
name: 'rrweb',
|
input: c.input,
|
||||||
format: 'iife',
|
plugins,
|
||||||
file: toMinPath(pkg.unpkg),
|
output: [
|
||||||
sourcemap: true,
|
{
|
||||||
},
|
name: c.name,
|
||||||
],
|
format: 'iife',
|
||||||
};
|
file: toMinPath(c.pathFn(pkg.unpkg)),
|
||||||
|
sourcemap: true,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export default configs;
|
export default configs;
|
||||||
|
|||||||
Reference in New Issue
Block a user