-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
38 lines (35 loc) · 999 Bytes
/
webpack.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
const HtmlWebpackPlugin = require("html-webpack-plugin");
const CopyWebpackPlugin = require('copy-webpack-plugin');
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;
const Path = require("path");
let buildFolder = Path.join(
__dirname,
"_build/default/src/client/app/src/client"
);
module.exports = (env) => ({
devtool: env.production ? false : "inline-cheap-module-source-map",
entry: {
app: Path.join(buildFolder, "/app.js"),
},
mode: env.production ? "production" : "development",
output: {
path: Path.join(__dirname, "public"),
filename: "[name].js",
},
plugins: [
(env.analize) ? new BundleAnalyzerPlugin({
analyzerMode: 'static',
reportFilename: 'analize.html',
}) : null,
new HtmlWebpackPlugin({
filename: "index.html",
template: "templates/index.html",
publicPath: "/public",
}),
new CopyWebpackPlugin({
patterns: [
{ from: 'assets'}
]
})
],
});