forked from OpenServer/OpenAuth_views
Making treeshaking dependent on production builds
This commit is contained in:
parent
f2e9de9423
commit
0922aa4c87
2
build.ts
2
build.ts
@ -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 => {
|
||||||
|
Loading…
Reference in New Issue
Block a user