forked from iotaledger/mam.client.js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
executable file
·42 lines (42 loc) · 1.2 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
module.exports = (env, options) => ({
entry: __dirname + '/src/node.js',
output: {
path: __dirname + '/lib',
filename: `mam${options.target === 'node' ? '.client' : '.web'}${options.mode === 'development' ? '' : '.min'}.js`,
library: 'Mam',
libraryTarget: 'umd',
umdNamedDefine: true
},
mode: options.mode,
target: options.target,
devtool: 'none',
module: {
rules: [
{
test: /\.js$/,
exclude: /node_modules/,
use: {
loader: 'babel-loader',
options: {
presets: [
[
'@babel/preset-env',
{
targets: {
browsers: '> 5%',
node: '6'
}
}
]
]
}
}
}
]
},
node: {
fs: 'empty',
child_process: 'empty',
path: 'empty'
}
})