forked from balloob/react-sidebar
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
executable file
·44 lines (42 loc) · 1.14 KB
/
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
39
40
41
42
43
44
const path = require("path");
const HtmlWebpackPlugin = require("html-webpack-plugin");
const { BundleAnalyzerPlugin } = require("webpack-bundle-analyzer");
const isProd = process.env.NODE_ENV === "production";
module.exports = {
entry: {
index: "./example/src/index",
responsive_example: "./example/src/responsive_example"
},
output: {
filename: "[name].js",
path: path.join(__dirname, "example/dist")
},
module: {
rules: [
{
test: /\.js$/,
use: "babel-loader",
exclude: /node_modules/
}
]
},
plugins: [
new BundleAnalyzerPlugin({
analyzerMode: isProd ? "static" : "disabled"
}),
new HtmlWebpackPlugin({
template: path.join(__dirname, "example/src/index.html"),
filename: path.join(__dirname, "example/dist/index.html"),
chunks: ["index"]
}),
new HtmlWebpackPlugin({
template: path.join(__dirname, "example/src/responsive_example.html"),
filename: path.join(__dirname, "example/dist/responsive_example.html"),
chunks: ["responsive_example"]
})
],
devServer: {
contentBase: "./example",
host: "0.0.0.0"
}
};