-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.prod.config.js
44 lines (36 loc) · 1.09 KB
/
webpack.prod.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
39
40
41
42
43
44
const path = require("path");
const webpack = require("webpack");
const webpackConfig = require("./webpack.config");
const CompressionPlugin = require("compression-webpack-plugin");
//const initialConfigPlugin = require("./src/init-config").initialConfigPlugin;
const HtmlWebpackPlugin = require("html-webpack-plugin");
var webpackProd = {
entry: webpackConfig.entry,
resolve: webpackConfig.resolve,
module: webpackConfig.module,
};
delete webpackProd.entry.server;
delete webpackProd.entry.hot;
//webpackProd.devtool = 'inline-source-map';
delete webpackProd.devtool;
webpackProd.output = {
filename: "[name].js",
publicPath: "https://www.eduid.se/static/front-build/",
path: path.join(__dirname, "build"),
};
webpackProd.plugins = [
// initialConfigPlugin,
new webpack.optimize.AggressiveMergingPlugin(), //Merge chunks
new CompressionPlugin(),
new HtmlWebpackPlugin({
hash: true,
template: `./public/index.html`,
filename: `index.html`,
chunks: `index`,
}),
];
webpackProd.mode = "production";
webpackProd.performance = {
hints: false,
};
module.exports = webpackProd;