mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-09-19 15:30:03 +02:00
Unify webpack build
This commit is contained in:
@@ -3,19 +3,16 @@ import nodeExternals from 'webpack-node-externals';
|
|||||||
import baseConfig from './webpack.config.base';
|
import baseConfig from './webpack.config.base';
|
||||||
|
|
||||||
export default (_env, args) => {
|
export default (_env, args) => {
|
||||||
switch (args.mode) {
|
|
||||||
case 'development':
|
|
||||||
return [
|
return [
|
||||||
|
// non-minified
|
||||||
baseConfig,
|
baseConfig,
|
||||||
|
// core [To be used by webpack/esbuild/vite etc to bundle mermaid]
|
||||||
merge(baseConfig, {
|
merge(baseConfig, {
|
||||||
externals: [nodeExternals()],
|
externals: [nodeExternals()],
|
||||||
output: {
|
output: {
|
||||||
filename: '[name].core.js',
|
filename: '[name].core.js',
|
||||||
},
|
},
|
||||||
}),
|
}),
|
||||||
];
|
|
||||||
case 'production':
|
|
||||||
return [
|
|
||||||
// umd
|
// umd
|
||||||
merge(baseConfig, {
|
merge(baseConfig, {
|
||||||
output: {
|
output: {
|
||||||
@@ -39,7 +36,4 @@ export default (_env, args) => {
|
|||||||
},
|
},
|
||||||
}),
|
}),
|
||||||
];
|
];
|
||||||
default:
|
|
||||||
throw new Error('No matching configuration was found!');
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
Reference in New Issue
Block a user