From 080f497eeeeddf6aa2290d007fc0a389864ef8d7 Mon Sep 17 00:00:00 2001 From: "Xin Du (Clark)" Date: Thu, 14 Oct 2021 14:21:55 +0100 Subject: [PATCH] fix(webpack): support jsx syntax in esbuild (#1014) --- packages/webpack/src/presets/esbuild.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/webpack/src/presets/esbuild.ts b/packages/webpack/src/presets/esbuild.ts index f720cbc141..27a90c2356 100644 --- a/packages/webpack/src/presets/esbuild.ts +++ b/packages/webpack/src/presets/esbuild.ts @@ -13,7 +13,7 @@ export function esbuild (ctx: WebpackConfigContext) { config.module.rules.push( { - test: /\.m?[jt]sx?$/i, + test: /\.m?[jt]s$/i, loader: 'esbuild-loader', exclude: (file) => { file = file.split('node_modules', 2)[1] @@ -35,7 +35,7 @@ export function esbuild (ctx: WebpackConfigContext) { } }, { - test: /\.tsx$/, + test: /\.m?[jt]sx$/, loader: 'esbuild-loader', options: { loader: 'tsx',