-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathwebpack.config.js
More file actions
48 lines (39 loc) · 902 Bytes
/
Copy pathwebpack.config.js
File metadata and controls
48 lines (39 loc) · 902 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
38
39
40
41
42
43
44
45
46
47
48
const path = require("path");
const webpack_rules = [];
const TerserPlugin = require('terser-webpack-plugin');
const babelLoader = {
test: /\.js$/,
use: {
loader: "babel-loader",
options: {
"presets": [
[
"@babel/preset-env"
],
],
}
}
};
webpack_rules.push(babelLoader);
module.exports = {
mode: 'production',
devtool: 'source-map',
entry: {
"app": "./index.js"
},
optimization: {
minimizer: [new TerserPlugin({
sourceMap: true
})],
},
output: {
libraryTarget: 'umd',
path: path.resolve(__dirname, 'dist'),
filename: 'kkiapay.bundle.js',
library: 'kkiapay',
globalObject: "typeof self !== 'undefined' ? self : this"
},
module: {
rules: webpack_rules
}
}