-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
35 lines (33 loc) · 993 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
var path = require("path");
var webpack = require('webpack');
var UglifyJsPlugin = require('uglifyjs-webpack-plugin');
var PROD = (process.env.NODE_ENV === "production");
var WEB = (process.env.USE_ENV === "web");
module.exports = {
entry: "./index.js",
target: WEB? "web" : "node",
output: {
filename: "bundle.js",
path: WEB? path.resolve(__dirname, "dist/web") : path.resolve(__dirname, "dist/node"),
library: "BigNumbers",
libraryTarget: WEB? "var" : "umd",
filename: PROD ? "big-numbers.min.js" : "big-numbers.js"
},
resolve: {
extensions: [".js"]
},
optimization: {
minimizer: PROD ? [
new UglifyJsPlugin({
cache: true,
parallel: true,
uglifyOptions: {
compress: false,
ecma: 5,
mangle: true
},
sourceMap: true
})
] : []
}
};