From 1352ee3a516b266e5789d3828a4c9155c5b36996 Mon Sep 17 00:00:00 2001 From: easy1090 <752355956@qq.com> Date: Wed, 31 Jan 2024 11:59:58 +0800 Subject: [PATCH] fix(rsdoctor): change loader config --- rsdoctor/arco-pro/rspack.config.js | 62 ++++++++++++++++-------------- 1 file changed, 33 insertions(+), 29 deletions(-) diff --git a/rsdoctor/arco-pro/rspack.config.js b/rsdoctor/arco-pro/rspack.config.js index f190aba2..f2aa6a09 100644 --- a/rsdoctor/arco-pro/rspack.config.js +++ b/rsdoctor/arco-pro/rspack.config.js @@ -36,44 +36,48 @@ const config = { { test: /\.(j|t)s$/, exclude: [/[\\/]node_modules[\\/]/], - loader: "builtin:swc-loader", - options: { - sourceMap: false, - jsc: { - parser: { - syntax: "typescript", + use: { + loader: "builtin:swc-loader", + options: { + sourceMap: false, + jsc: { + parser: { + syntax: "typescript", + }, + externalHelpers: true, + }, + env: { + targets: "Chrome >= 48", }, - externalHelpers: true, - }, - env: { - targets: "Chrome >= 48", }, - }, + } }, { test: /\.(j|t)sx$/, - loader: "builtin:swc-loader", exclude: [/[\\/]node_modules[\\/]/], - options: { - sourceMap: false, - jsc: { - parser: { - syntax: "typescript", - tsx: true, - }, - transform: { - react: { - runtime: "automatic", - development: !prod, - refresh: !prod, + use: { + loader: "builtin:swc-loader", + options: { + sourceMap: false, + jsc: { + parser: { + syntax: "typescript", + tsx: true, }, + transform: { + react: { + runtime: "automatic", + development: !prod, + refresh: !prod, + }, + }, + externalHelpers: true, + }, + env: { + targets: "Chrome >= 48", }, - externalHelpers: true, - }, - env: { - targets: "Chrome >= 48", }, - }, + } }, { test: /\.png$/,