From 6d14fa88e85d4c9e264be394ddb37a54ca6738a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=89=E5=92=B2=E6=99=BA=E5=AD=90=20Kevin=20Deng?= Date: Tue, 19 Sep 2023 23:13:39 +0800 Subject: [PATCH] fix(build): disable useDefineForClassFields in esbuild (#9252) --- rollup.config.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/rollup.config.js b/rollup.config.js index 7050ba437e6..5898f1f9db9 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -273,6 +273,13 @@ function createConfig(format, output, plugins = []) { return nodePlugins } + /** @satisfies {import('esbuild').TsconfigRaw} */ + const tsconfigRaw = { + compilerOptions: { + useDefineForClassFields: false + } + } + return { input: resolve(entryFile), // Global and Browser ESM builds inlines everything so that they can be @@ -292,7 +299,9 @@ function createConfig(format, output, plugins = []) { sourceMap: output.sourcemap, minify: false, target: isServerRenderer || isNodeBuild ? 'es2019' : 'es2015', - define: resolveDefine() + define: resolveDefine(), + // @ts-expect-error + tsconfigRaw }), ...resolveNodePlugins(), ...plugins