mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-11-26 01:23:49 +01:00
MISC: Fix support of react-refresh-webpack-plugin (#1392)
This commit is contained in:
parent
e76e254c3e
commit
2198a02152
@ -10,7 +10,7 @@ module.exports = (env, argv) => {
|
|||||||
const isDevServer = (env || {}).devServer === true;
|
const isDevServer = (env || {}).devServer === true;
|
||||||
const runInContainer = (env || {}).runInContainer === true;
|
const runInContainer = (env || {}).runInContainer === true;
|
||||||
const isDevelopment = argv.mode === "development";
|
const isDevelopment = argv.mode === "development";
|
||||||
const isFastRefresh = argv.fast === "true";
|
const enableReactRefresh = (env || {}).enableReactRefresh === true;
|
||||||
const outputDirectory = "dist";
|
const outputDirectory = "dist";
|
||||||
const entry = "./src/index.tsx";
|
const entry = "./src/index.tsx";
|
||||||
|
|
||||||
@ -126,7 +126,7 @@ module.exports = (env, argv) => {
|
|||||||
columns: true,
|
columns: true,
|
||||||
module: true,
|
module: true,
|
||||||
}),
|
}),
|
||||||
isFastRefresh && new ReactRefreshWebpackPlugin(),
|
enableReactRefresh && new ReactRefreshWebpackPlugin(),
|
||||||
].filter(Boolean),
|
].filter(Boolean),
|
||||||
target: "web",
|
target: "web",
|
||||||
entry: entry,
|
entry: entry,
|
||||||
@ -143,7 +143,7 @@ module.exports = (env, argv) => {
|
|||||||
use: {
|
use: {
|
||||||
loader: "babel-loader",
|
loader: "babel-loader",
|
||||||
options: {
|
options: {
|
||||||
plugins: [isFastRefresh && require.resolve("react-refresh/babel")].filter(Boolean),
|
plugins: [enableReactRefresh && require.resolve("react-refresh/babel")].filter(Boolean),
|
||||||
cacheDirectory: true,
|
cacheDirectory: true,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user