Provide an option to only build rrweb-snapshot for inclusion in rrweb (#649)
This commit is contained in:
@@ -7,6 +7,7 @@
|
||||
"prepack": "npm run bundle && npm run typings",
|
||||
"test": "cross-env TS_NODE_CACHE=false TS_NODE_FILES=true mocha -r ts-node/register test/**/*.ts",
|
||||
"bundle": "rollup --config",
|
||||
"bundle:es-only": "cross-env ES_ONLY=true rollup --config",
|
||||
"typings": "tsc -d --declarationDir typings"
|
||||
},
|
||||
"repository": {
|
||||
|
||||
@@ -6,7 +6,20 @@ function toMinPath(path) {
|
||||
return path.replace(/\.js$/, '.min.js');
|
||||
}
|
||||
|
||||
export default [
|
||||
let configs = [
|
||||
// ES module - for building rrweb
|
||||
{
|
||||
input: './src/index.ts',
|
||||
plugins: [typescript()],
|
||||
output: [
|
||||
{
|
||||
format: 'esm',
|
||||
file: pkg.module,
|
||||
},
|
||||
],
|
||||
},
|
||||
];
|
||||
let extra_configs = [
|
||||
// browser
|
||||
{
|
||||
input: './src/index.ts',
|
||||
@@ -42,17 +55,7 @@ export default [
|
||||
},
|
||||
],
|
||||
},
|
||||
// ES module
|
||||
{
|
||||
input: './src/index.ts',
|
||||
plugins: [typescript()],
|
||||
output: [
|
||||
{
|
||||
format: 'esm',
|
||||
file: pkg.module,
|
||||
},
|
||||
],
|
||||
},
|
||||
// ES module (packed)
|
||||
{
|
||||
input: './src/index.ts',
|
||||
plugins: [typescript(), terser()],
|
||||
@@ -65,3 +68,9 @@ export default [
|
||||
],
|
||||
},
|
||||
];
|
||||
|
||||
if (!process.env.ES_ONLY) {
|
||||
configs.push(...extra_configs);
|
||||
}
|
||||
|
||||
export default configs;
|
||||
|
||||
Reference in New Issue
Block a user