diff options
author | crupest <crupest@outlook.com> | 2021-06-03 15:00:26 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2021-06-03 15:00:26 +0800 |
commit | 009d49e5b5cf7f7568e4b17961aa11b36d589a90 (patch) | |
tree | 7f28d980b8aa74c6159cf6c5b08941d93d49c30e /FrontEnd/webpack.config.dev.js | |
parent | 125c77d974c90b547ec3f89e71ad6420f1668fd3 (diff) | |
download | timeline-009d49e5b5cf7f7568e4b17961aa11b36d589a90.tar.gz timeline-009d49e5b5cf7f7568e4b17961aa11b36d589a90.tar.bz2 timeline-009d49e5b5cf7f7568e4b17961aa11b36d589a90.zip |
build: Good bye babel!
Diffstat (limited to 'FrontEnd/webpack.config.dev.js')
-rw-r--r-- | FrontEnd/webpack.config.dev.js | 22 |
1 files changed, 7 insertions, 15 deletions
diff --git a/FrontEnd/webpack.config.dev.js b/FrontEnd/webpack.config.dev.js index a657861b..4c6031c7 100644 --- a/FrontEnd/webpack.config.dev.js +++ b/FrontEnd/webpack.config.dev.js @@ -1,22 +1,18 @@ const path = require("path");
const ReactRefreshWebpackPlugin = require("@pmmmwh/react-refresh-webpack-plugin");
+const ReactRefreshTypeScript = require("react-refresh-typescript");
const config = require("./webpack.common");
config.mode("development");
config.module
- .rule("ts")
- .use("babel")
+ .rule("jsts")
+ .use("ts")
.options({
- plugins: ["react-refresh/babel"],
- });
-
-config.module
- .rule("js")
- .use("babel")
- .options({
- plugins: ["react-refresh/babel"],
+ getCustomTransformers: () => ({
+ before: [ReactRefreshTypeScript()],
+ }),
});
config.module
@@ -35,11 +31,7 @@ config.module config.devtool("eval-cheap-module-source-map");
-config.devServer
- .contentBase(path.resolve(__dirname, "public/"))
- .port(3000)
- .historyApiFallback(true)
- .hot(true);
+config.devServer.port(3000).historyApiFallback(true).hot(true);
config.plugin("react-refresh").use(new ReactRefreshWebpackPlugin());
|