-
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathwebpack.dev.js
More file actions
33 lines (28 loc) · 794 Bytes
/
webpack.dev.js
File metadata and controls
33 lines (28 loc) · 794 Bytes
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
// Important modules this config uses
const path = require("path");
const HtmlWebpackPlugin = require("html-webpack-plugin");
module.exports = require("./webpack.base")({
// In production, we skip all hot-reloading stuff
entry: [path.join(__dirname, "/src/index.tsx")],
// Utilize long-term caching by adding content hashes (not compilation hashes) to compiled assets
output: {
filename: "index.js",
path: path.join(__dirname, "/build")
},
devServer: {
contentBase: path.join(__dirname, "src"),
hot: true,
compress: true,
port: 4000,
publicPath: "/",
historyApiFallback: true
},
plugins: [
// Minify and optimize the index.html
new HtmlWebpackPlugin({
template: path.join(__dirname, "/src/index.html"),
inject: true,
filename: "index.html"
})
]
});