-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.build.js
42 lines (41 loc) · 1.14 KB
/
webpack.build.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
39
40
41
42
// const TerserPlugin = require("terser-webpack-plugin");
const commonConfig = require("./webpack.common");
// const BundleAnalyzerPlugin =
// require("webpack-bundle-analyzer").BundleAnalyzerPlugin;
module.exports = () => {
return {
...commonConfig,
mode: "production",
devtool: "source-map",
entry: {
utils: "./src/utils/index.js",
helpers: "./src/helpers/index.js",
hooks: "./src/hooks/index.js",
services: "./src/services/index.js",
downloads: "./src/downloads/index.js",
index: "./src/index.js",
},
output: {
library: "lib",
libraryTarget: "umd",
globalObject: "this", // to make this build work for browser & node env. Fix for next.js integration (window not defined)
filename: "[name].js",
},
externals: {
react: "react",
},
// plugins: [new BundleAnalyzerPlugin()],
// optimization: {
// minimize: true,
// minimizer: [
// new TerserPlugin({
// terserOptions: {
// compress: {
// pure_funcs: ["console.log"],
// },
// },
// }),
// ],
// },
};
};