forked from dapi-labs/react-nice-avatar
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathproduction.js
36 lines (34 loc) · 911 Bytes
/
production.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 webpack = require("webpack");
const merge = require("webpack-merge");
const TsconfigPathsPlugin = require("tsconfig-paths-webpack-plugin");
const TerserJSPlugin = require("terser-webpack-plugin");
const baseConfig = require("./base");
module.exports = merge(baseConfig, {
mode: "production",
devtool: false,
resolve: {
unsafeCache: true,
plugins: [
new TsconfigPathsPlugin({ configFile: path.resolve(__dirname, "../tsconfig.json") })
]
},
entry: {
index: path.resolve(__dirname, "../src/index.tsx")
},
output: {
filename: "[name].js",
path: path.resolve(__dirname, "../dist"),
libraryTarget: 'commonjs2'
},
plugins: [
new webpack.DefinePlugin({
"process.env.NODE_ENV": JSON.stringify("production")
})
],
optimization: {
minimizer: [
new TerserJSPlugin({ extractComments: false })
]
}
});