From cf0ec2b0c8033e363a304802fefaff7955ee8d4e Mon Sep 17 00:00:00 2001 From: yushijie1 Date: Thu, 23 Jan 2025 16:15:21 +0800 Subject: [PATCH] =?UTF-8?q?fix(h5):=20=E6=94=AF=E6=8C=81=E9=80=9A=E8=BF=87?= =?UTF-8?q?taro=E6=8F=92=E4=BB=B6=E4=BF=AE=E6=94=B9babelloader=E6=8F=92?= =?UTF-8?q?=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/taro-platform-h5/src/program.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/taro-platform-h5/src/program.ts b/packages/taro-platform-h5/src/program.ts index a635cf8a683d..45655bab27b4 100644 --- a/packages/taro-platform-h5/src/program.ts +++ b/packages/taro-platform-h5/src/program.ts @@ -96,9 +96,11 @@ export default class H5 extends TaroPlatformWeb { const rules = chain.module.rules const script = rules.get('script') const babelLoader = script.uses.get('babelLoader') + const options = babelLoader.get('options') babelLoader.set('options', { - ...babelLoader.get('options'), + ...options, plugins: [ + ...(options.plugins || []), [ require('babel-plugin-transform-taroapi'), {