2022-01-01 23:58:44 +00:00
|
|
|
const path = require("path");
|
|
|
|
const webpack = require("webpack");
|
|
|
|
|
|
|
|
module.exports = {
|
|
|
|
entry: "./src/index.js",
|
|
|
|
output: {
|
|
|
|
path: path.resolve(__dirname, "./static/frontend"),
|
|
|
|
filename: "[name].js",
|
|
|
|
},
|
|
|
|
module: {
|
|
|
|
rules: [
|
|
|
|
{
|
|
|
|
test: /\.js$/,
|
|
|
|
exclude: /node_modules/,
|
|
|
|
use: {
|
|
|
|
loader: "babel-loader",
|
|
|
|
},
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
optimization: {
|
|
|
|
minimize: true,
|
|
|
|
},
|
2022-03-25 19:47:01 +00:00
|
|
|
|
2022-01-01 23:58:44 +00:00
|
|
|
plugins: [
|
|
|
|
new webpack.DefinePlugin({
|
|
|
|
"process.env": {
|
|
|
|
// This has effect on the react lib size
|
|
|
|
NODE_ENV: JSON.stringify("production"),
|
|
|
|
},
|
|
|
|
}),
|
2022-03-25 19:47:01 +00:00
|
|
|
//new webpack.optimize.AggressiveMergingPlugin() //Merge chunks
|
2022-01-01 23:58:44 +00:00
|
|
|
],
|
2022-01-08 13:08:03 +00:00
|
|
|
resolve: {
|
|
|
|
extensions: ['.ts', '.js'],
|
|
|
|
},
|
2022-01-01 23:58:44 +00:00
|
|
|
};
|