arco-design / arco-plugins

Webpack / Vite plugins for Arco Design
https://arco.design
MIT License
65 stars 39 forks source link

fix: merge babel preset #42

Closed xuchaobei closed 1 year ago

xuchaobei commented 1 year ago

Types of changes

Background and context

当 option 中设置了 preset 时,如果 preset 和 插件中默认的 preset 重复,构建会失败。 例如,期望更改插件中默认使用的 @babel/preset-react 的配置,会出现此问题:

 babelConfig: {
            presets: [
              [
                '@babel/preset-react',
                {
                  runtime: 'automatic', 
                },
              ],
            ],
}

Solution

当检测存在重复 preset 时,合并 preset 的 option,而不是直接追加 preset。

How is the change tested?

Changelog

Changelog(CN) Changelog(EN) Related issues

Checklist:

Other information