fix(admin-ui): modify webpack config to prevent throwing sourcemap errors (#5484)
This commit is contained in:
committed by
GitHub
parent
8f5b5b51a9
commit
b69f182571
@@ -54,12 +54,11 @@ export function getWebpackConfig({
|
||||
fancy: reporting === "fancy",
|
||||
}),
|
||||
]
|
||||
: [new MiniCssExtractPlugin()]
|
||||
: [new MiniCssExtractPlugin(), new ReactRefreshPlugin()]
|
||||
|
||||
return {
|
||||
mode: env,
|
||||
bail: !!isProd,
|
||||
devtool: isProd ? false : "eval-source-map",
|
||||
devtool: isProd ? false : "inline-source-map",
|
||||
entry: [entry],
|
||||
output: {
|
||||
path: dest,
|
||||
@@ -91,6 +90,8 @@ export function getWebpackConfig({
|
||||
transform: {
|
||||
react: {
|
||||
runtime: "automatic",
|
||||
development: !isProd,
|
||||
refresh: !isProd,
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -146,11 +147,6 @@ export function getWebpackConfig({
|
||||
test: /\.(eot|otf|ttf|woff|woff2)$/,
|
||||
type: "asset/resource",
|
||||
},
|
||||
{
|
||||
test: /\.(js|mjs)(\.map)?$/,
|
||||
enforce: "pre",
|
||||
use: ["source-map-loader"],
|
||||
},
|
||||
{
|
||||
test: /\.m?jsx?$/,
|
||||
resolve: {
|
||||
@@ -188,9 +184,8 @@ export function getWebpackConfig({
|
||||
],
|
||||
}),
|
||||
|
||||
!isProd && new ReactRefreshPlugin(),
|
||||
|
||||
...webpackPlugins,
|
||||
].filter(Boolean),
|
||||
stats: isProd ? "errors-only" : "errors-warnings",
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user