-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.config.js
More file actions
35 lines (32 loc) · 873 Bytes
/
webpack.config.js
File metadata and controls
35 lines (32 loc) · 873 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
34
35
const HtmlWebpackPlugin = require("html-webpack-plugin");
const { merge } = require("webpack-merge");
const common = require("./webpack.common");
const { resolve } = require("path");
const PATH = resolve(`${__dirname}/build`);
module.exports = merge(common, {
devtool: 'inline-source-map',
devServer: { // [1]
historyApiFallback: true, // [2]
port: 3000,
static: {
directory: PATH
}
},
output: {
filename: "main.js",
path: PATH
},
plugins: [
new HtmlWebpackPlugin({
template: resolve(`${__dirname}/public/index.html`)
})
]
});
/*
NOTES
[1] Webpack's dev server bundles files and then performs read/write
operations in memory so you will never see files related to local
development written to the disk.
[2] This allows the user to refresh at a nested route (e.g. "/about")
and still load the page.
*/