-
Notifications
You must be signed in to change notification settings - Fork 72
/
webpack.config.js
44 lines (38 loc) · 1.14 KB
/
webpack.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
const CopyWebpackPlugin = require('copy-webpack-plugin');
const { DefinePlugin } = require('webpack');
module.exports = (env, argv) => {
const mode = argv.mode || 'development';
const devtool = mode === 'development' ? 'eval-source-map' : 'source-map';
return {
mode,
entry: {
viewer: './example/src/viewer.js',
modeler: './example/src/modeler.js'
},
output: {
filename: 'dist/[name].js',
path: __dirname + '/example'
},
module: {
rules: [
{
test: /\.bpmn$/,
type: 'asset/source'
}
]
},
plugins: [
new CopyWebpackPlugin({
patterns: [
{ from: './assets', to: 'dist/vendor/bpmn-js-token-simulation/assets' },
{ from: 'bpmn-js/dist/assets', context: 'node_modules', to: 'dist/vendor/bpmn-js/assets' },
{ from: '@bpmn-io/properties-panel/dist/assets', context: 'node_modules', to: 'dist/vendor/bpmn-js-properties-panel/assets' }
]
}),
new DefinePlugin({
'process.env.TOKEN_SIMULATION_VERSION': JSON.stringify(require('./package.json').version)
})
],
devtool
};
};