aboutsummaryrefslogtreecommitdiff
path: root/FrontEnd/webpack.config.dev.js
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2020-10-31 00:42:06 +0800
committerGitHub <noreply@github.com>2020-10-31 00:42:06 +0800
commit1b80b699e477a0c14a069401cf39126d19668bf0 (patch)
tree0d1c10cd42398bea87e0169e8a4ec385b71f49bc /FrontEnd/webpack.config.dev.js
parent0062a22423806c9501752132133e14de02355760 (diff)
parent5875e7a19ff8eb244e2849647ba35aa898de6b52 (diff)
downloadtimeline-1b80b699e477a0c14a069401cf39126d19668bf0.tar.gz
timeline-1b80b699e477a0c14a069401cf39126d19668bf0.tar.bz2
timeline-1b80b699e477a0c14a069401cf39126d19668bf0.zip
Merge pull request #161 from crupest/upgrade
Upgrade packages and split front end and back end.
Diffstat (limited to 'FrontEnd/webpack.config.dev.js')
-rw-r--r--FrontEnd/webpack.config.dev.js53
1 files changed, 53 insertions, 0 deletions
diff --git a/FrontEnd/webpack.config.dev.js b/FrontEnd/webpack.config.dev.js
new file mode 100644
index 00000000..937ab3fb
--- /dev/null
+++ b/FrontEnd/webpack.config.dev.js
@@ -0,0 +1,53 @@
+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.module
+ .rule("ts")
+ .use("babel")
+ .options({
+ plugins: ["react-refresh/babel"],
+ });
+
+config.module
+ .rule("js")
+ .use("babel")
+ .options({
+ plugins: ["react-refresh/babel"],
+ });
+
+config.module
+ .rule("css")
+ .use("style")
+ .before("css")
+ .loader("style-loader")
+ .end();
+
+config.module
+ .rule("sass")
+ .use("style")
+ .before("css")
+ .loader("style-loader")
+ .end();
+
+config.devtool("eval-cheap-module-source-map");
+
+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);
+
+config.plugin("hot").use(webpack.HotModuleReplacementPlugin);
+config.plugin("react-refresh").use(new ReactRefreshWebpackPlugin());
+
+module.exports = config.toConfig();