Unify webpack build

This commit is contained in:
Sidharth Vinod 2022-09-12 11:41:26 +05:30
parent a3bda3c559
commit e740325d84
No known key found for this signature in database
GPG Key ID: FB5CCD378D3907CD

View File

@ -3,19 +3,16 @@ import nodeExternals from 'webpack-node-externals';
import baseConfig from './webpack.config.base';
export default (_env, args) => {
switch (args.mode) {
case 'development':
return [
// non-minified
baseConfig,
// core [To be used by webpack/esbuild/vite etc to bundle mermaid]
merge(baseConfig, {
externals: [nodeExternals()],
output: {
filename: '[name].core.js',
},
}),
];
case 'production':
return [
// umd
merge(baseConfig, {
output: {
@ -39,7 +36,4 @@ export default (_env, args) => {
},
}),
];
default:
throw new Error('No matching configuration was found!');
}
};