-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathwebpack.config.dev.js
More file actions
35 lines (33 loc) · 896 Bytes
/
webpack.config.dev.js
File metadata and controls
35 lines (33 loc) · 896 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
/* eslint @typescript-eslint/no-var-requires: 0 */
const baseConfig = require("./webpack.config");
const path = require("path");
const HtmlWebpackPlugin = require("html-webpack-plugin");
const port = 3060;
module.exports = {
...baseConfig,
entry: ["react-hot-loader/patch", "./src/dev/index.tsx"],
target: "web", // Ideally we'd use "browserslist" from the base, but it stops HMR from working.
resolve: {
...baseConfig.resolve,
alias: {
...baseConfig.resolve.alias,
"react-dom": "@hot-loader/react-dom"
}
},
externals: [],
cache: true,
mode: "development",
plugins: [
...baseConfig.plugins,
new HtmlWebpackPlugin({
title: "Bytescale Upload Widget (React)",
template: path.resolve(__dirname, "src/dev/index.html"),
filename: "index.html" // output file
})
],
devServer: {
hot: true,
open: true,
port
}
};