-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathwebpack.config.cjs
More file actions
37 lines (34 loc) · 814 Bytes
/
webpack.config.cjs
File metadata and controls
37 lines (34 loc) · 814 Bytes
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
const webpack = require('webpack');
const nodeConfig = {
entry: './app.js',
mode: 'production',
target: 'node',
output: {
filename: 'sqomplexity.js'
},
plugins: [
new webpack.DefinePlugin({
VERSION: JSON.stringify(process.env.npm_package_version)
})
]
};
const webConfig = {
entry: './src/sqomplexity.js',
mode: 'production',
target: 'web',
output: {
filename: 'sqomplexity.umd.js',
globalObject: 'this',
library: {
name: '$sqomplexity',
type: 'umd',
export: 'Sqomplexity'
}
},
plugins: [
new webpack.DefinePlugin({
VERSION: JSON.stringify(process.env.npm_package_version)
})
]
};
module.exports = [nodeConfig, webConfig];