From 1f7bbe58c37f627823d585184b90c58d7634740f Mon Sep 17 00:00:00 2001 From: jmfrancois Date: Wed, 11 Oct 2023 11:07:20 +0200 Subject: [PATCH] fix: make it only used on js and jsx --- tools/scripts-config-swc/.swcrc | 2 +- tools/scripts-core/src/scripts/build-lib.js | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/tools/scripts-config-swc/.swcrc b/tools/scripts-config-swc/.swcrc index 3ff11841d7..eccdc1bb18 100644 --- a/tools/scripts-config-swc/.swcrc +++ b/tools/scripts-config-swc/.swcrc @@ -2,7 +2,7 @@ "$schema": "https://json.schemastore.org/swcrc", "jsc": { "parser": { - "syntax": "typescript", + "syntax": "ecmascript", "jsx": true, "dynamicImport": false, "privateMethod": false, diff --git a/tools/scripts-core/src/scripts/build-lib.js b/tools/scripts-core/src/scripts/build-lib.js index b81193c989..0b9fa25e8a 100755 --- a/tools/scripts-core/src/scripts/build-lib.js +++ b/tools/scripts-core/src/scripts/build-lib.js @@ -28,8 +28,7 @@ export default async function build(env, presetApi, unsafeOptions) { const babelConfigPath = getUserConfigFile(['.babelrc', '.babelrc.json', 'babel.config.js']) || path.join(babelRootPath, '.babelrc.json'); - const swcConfigPath = - getUserConfigFile(['.swcrc']) || path.join(swcRootPath, '.swcrc-typescript'); + const swcConfigPath = getUserConfigFile(['.swcrc']) || path.join(swcRootPath, '.swcrc'); const tscConfigPath = getUserConfigFile(['tsconfig.build.json', 'tsconfig.json']) || path.join(tsRootPath, 'tsconfig.json'); @@ -63,7 +62,7 @@ export default async function build(env, presetApi, unsafeOptions) { // @see https://github.com/babel/babel/issues/12008 '**/*.test.js,**/*.test.ts,**/*.test.tsx,**/*.spec.js,**/*.spec.ts,**/*.spec.tsx,**/*.stories.js,**/*.stories.ts,**/*.stories.tsx', '--extensions', - '.js,.ts,.tsx,.jsx', + '.js,.jsx', ...options, ], {