chore: prevent double bundling
Ensure we build the distribution only once: * development build with NODE_ENV=development * production build with NODE_ENV=production
This commit is contained in:
parent
4dc7122983
commit
732aae361e
|
@ -45,7 +45,7 @@ const configs = distros.reduce(function(configs, distro) {
|
|||
},
|
||||
plugins: pgl([
|
||||
banner(output)
|
||||
])
|
||||
], 'development')
|
||||
},
|
||||
{
|
||||
input: `./lib/${input}.js`,
|
||||
|
@ -61,7 +61,7 @@ const configs = distros.reduce(function(configs, distro) {
|
|||
comments: /license|@preserve/
|
||||
}
|
||||
})
|
||||
])
|
||||
], 'production')
|
||||
}
|
||||
];
|
||||
}, []);
|
||||
|
@ -92,10 +92,10 @@ function banner(bundleName, minified) {
|
|||
});
|
||||
}
|
||||
|
||||
function pgl(plugins=[]) {
|
||||
function pgl(plugins=[], env='production') {
|
||||
return [
|
||||
replace({
|
||||
'process.env.NODE_ENV': JSON.stringify('production')
|
||||
'process.env.NODE_ENV': JSON.stringify(env)
|
||||
}),
|
||||
nodeResolve({
|
||||
mainFields: [
|
||||
|
|
|
@ -33,13 +33,7 @@ cp('./assets/bpmn-js.css', dest + '/assets');
|
|||
|
||||
console.log('building pre-packaged distributions');
|
||||
|
||||
var NODE_ENV = process.env.NODE_ENV;
|
||||
|
||||
[ 'production', 'development' ].forEach(function(env) {
|
||||
|
||||
try {
|
||||
process.env.NODE_ENV = env;
|
||||
|
||||
exec('rollup', [ '-c' ], {
|
||||
stdio: 'inherit'
|
||||
});
|
||||
|
@ -49,7 +43,4 @@ var NODE_ENV = process.env.NODE_ENV;
|
|||
process.exit(1);
|
||||
}
|
||||
|
||||
process.env.NODE_ENV = NODE_ENV;
|
||||
});
|
||||
|
||||
console.log('done.');
|
Loading…
Reference in New Issue