aboutsummaryrefslogtreecommitdiff
path: root/FrontEnd/webpack.config.dev.js
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2020-10-27 21:38:59 +0800
committercrupest <crupest@outlook.com>2020-10-27 21:38:59 +0800
commitb6495ef9f7d6466f9347b02e83ec0935d63af23e (patch)
tree3becaab1f003c19afaca440185317fa539391cc6 /FrontEnd/webpack.config.dev.js
parent56989fcfddbfa75636260fc70b8db0125588aef1 (diff)
downloadtimeline-b6495ef9f7d6466f9347b02e83ec0935d63af23e.tar.gz
timeline-b6495ef9f7d6466f9347b02e83ec0935d63af23e.tar.bz2
timeline-b6495ef9f7d6466f9347b02e83ec0935d63af23e.zip
...
Diffstat (limited to 'FrontEnd/webpack.config.dev.js')
-rw-r--r--FrontEnd/webpack.config.dev.js15
1 files changed, 8 insertions, 7 deletions
diff --git a/FrontEnd/webpack.config.dev.js b/FrontEnd/webpack.config.dev.js
index c88e1aaf..937ab3fb 100644
--- a/FrontEnd/webpack.config.dev.js
+++ b/FrontEnd/webpack.config.dev.js
@@ -1,24 +1,23 @@
const path = require("path");
const webpack = require("webpack");
+const ReactRefreshWebpackPlugin = require("@pmmmwh/react-refresh-webpack-plugin");
const config = require("./webpack.common");
config.mode("development");
-config.entry("index").add("react-hot-loader/patch");
-
config.module
.rule("ts")
.use("babel")
.options({
- plugins: ["react-hot-loader/babel"],
+ plugins: ["react-refresh/babel"],
});
config.module
.rule("js")
.use("babel")
.options({
- plugins: ["react-hot-loader/babel"],
+ plugins: ["react-refresh/babel"],
});
config.module
@@ -37,16 +36,18 @@ config.module
config.devtool("eval-cheap-module-source-map");
-config.resolve.alias.set("react-dom", "@hot-loader/react-dom");
+config.resolve.set("fallback", {
+ querystring: require.resolve("querystring-es3"),
+});
config.devServer
.contentBase(path.resolve(__dirname, "public/"))
.host("0.0.0.0")
.port(3000)
.historyApiFallback(true)
- .hotOnly(true)
- .allowedHosts.add(".myide.io");
+ .hotOnly(true);
config.plugin("hot").use(webpack.HotModuleReplacementPlugin);
+config.plugin("react-refresh").use(new ReactRefreshWebpackPlugin());
module.exports = config.toConfig();