-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathwebpack.config.js
More file actions
55 lines (54 loc) · 1.36 KB
/
webpack.config.js
File metadata and controls
55 lines (54 loc) · 1.36 KB
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
43
44
45
46
47
48
49
50
51
52
53
54
55
const HtmlWebPackPlugin = require("html-webpack-plugin");
const UglifyJsPlugin = require("uglifyjs-webpack-plugin");
const webpack = require("webpack");
const path = require("path");
module.exports = () => {
return {
entry: "./src/index.js",
output: {
filename: "main.js",
path: path.resolve(__dirname, "dist"),
},
module: {
rules: [
{
test: /\.(js|jsx)$/,
exclude: /(node_modules)/,
use: {
loader: "babel-loader",
},
},
{
test: /\.(css|scss)$/,
loader: ["style-loader", "css-loader", "sass-loader"],
},
],
},
plugins: [
new HtmlWebPackPlugin({
template: "./public/index.html",
filename: "./index.html",
}),
new webpack.DefinePlugin({
// <-- key to reducing React's size
"process.env": {
NODE_ENV: JSON.stringify("production"),
},
}),
new webpack.IgnorePlugin(/^\.\/locale$/, /moment$/),
new webpack.optimize.AggressiveMergingPlugin(),
new RollbarSourceMapPlugin({
accessToken: "5038f24f7a3042a9a3a8784cb526e72c",
version: "1.0",
publicPath: "https://www.agfusion.app/",
}),
],
node: {
fs: "empty",
},
optimization: {
minimize: true,
minimizer: [new UglifyJsPlugin()],
},
};
};