-
-
Notifications
You must be signed in to change notification settings - Fork 28
/
Copy pathwebpack.config.js
38 lines (35 loc) · 1.08 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
const path = require("path");
const webpack = require('webpack');
const TerserPlugin = require('terser-webpack-plugin');
var PROD = (process.env.NODE_ENV === "production");
var WEB = (process.env.USE_ENV === "web");
module.exports = {
entry: "./lib/big-decimal",
target: [WEB ? "web" : "node", "es5"],
output: {
filename: "bundle.js",
path: WEB ? path.resolve(__dirname, "dist/web") : path.resolve(__dirname, "dist/node"),
library: {
name: "bigDecimal",
type: WEB ? "var" : "umd",
export: "default"
},
filename: PROD ? "js-big-decimal.min.js" : "js-big-decimal.js"
},
resolve: {
extensions: [".webpack.js", ".web.js", ".ts", ".js"]
},
optimization: {
minimizer: PROD ? [
new TerserPlugin({
terserOptions: {
ecma: undefined,
warnings: false,
sourceMap: true,
mangle: true,
keep_classnames: true
},
})
] : []
}
}