Making treeshaking dependent on production builds

This commit is contained in:
Fabian Stamm 2020-02-07 19:33:24 +01:00
parent f2e9de9423
commit 0922aa4c87

View File

@ -48,6 +48,7 @@ let configs = pages.map(page => {
watch: { watch: {
clearScreen: false clearScreen: false
}, },
treeshake: production,
plugins: [ plugins: [
(typescript as any)({ (typescript as any)({
tsconfig: "./src/tsconfig.json" tsconfig: "./src/tsconfig.json"
@ -121,7 +122,6 @@ if (process.argv.indexOf("-w") >= 0) {
} else { } else {
start = process.hrtime(); start = process.hrtime();
Promise.all(configs.map(config => { Promise.all(configs.map(config => {
config.treeshake = true;
return rollup.rollup(config).then((value) => { return rollup.rollup(config).then((value) => {
return value.write(Array.isArray(config.output) ? config.output[0] : config.output); return value.write(Array.isArray(config.output) ? config.output[0] : config.output);
}).catch(err => { }).catch(err => {