Skip to content

Commit

Permalink
fix(h5): 支持通过taro插件修改babelloader插件
Browse files Browse the repository at this point in the history
  • Loading branch information
yushijie1 committed Jan 23, 2025
1 parent 70d4824 commit cf0ec2b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/taro-platform-h5/src/program.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'),
{
Expand Down

0 comments on commit cf0ec2b

Please sign in to comment.