forked from sculove/Kiwoom-Helper
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.config.js
More file actions
41 lines (40 loc) · 790 Bytes
/
webpack.config.js
File metadata and controls
41 lines (40 loc) · 790 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
var NODE_ENV = process.env.NODE_ENV || 'development';
var webpack = require("webpack");
var config = {
context: __dirname + '/src',
entry : {
build : "./kiwoom-helper.js"
},
output: {
filename : NODE_ENV === "production" ? "kiwoom-helper.min.js" : "kiwoom-helper.js",
path: __dirname + "/dist"
},
// devtool: NODE_ENV === "production" ? "source-map" : "inline-source-map",
module: {
loaders: [
{
test: /\.js$/,
loader: "babel-loader",
exclude: /node_modules/,
query: {
presets: [
"es2015-loose"
]
}
}
]
},
plugins: [
]
};
if (NODE_ENV === 'production') {
config.plugins.push(
new webpack.optimize.UglifyJsPlugin({
compress: {
warnings: false,
drop_console: true
},
})
);
}
module.exports = config;