forked from diafygi/webrtc-ips
-
-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathwebpack.config.js
36 lines (34 loc) · 847 Bytes
/
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
const path = require('path');
const outPath = path.resolve(__dirname, 'dist');
module.exports = (env, argv) => {
const mode = argv.mode || 'development';
const isProd = mode === 'production';
const filename = isProd ? 'bundle.prod.js' : 'bundle.dev.js';
return {
mode,
entry: './src',
output: {
path: outPath,
library: 'WebRTC_IPs',
libraryTarget: 'umd',
filename,
// see: https://github.com/markdalgleish/static-site-generator-webpack-plugin/issues/130
globalObject: 'this',
},
devtool: isProd ? '' : 'source-map',
module: {
rules: [
{
test: /\.js$/,
exclude: /node_modules/,
use: {
loader: 'babel-loader',
options: {
presets: ['env']
}
}
}
]
},
};
};