From 9c3cf323fea7d1490b6a2a7eedc493c60eb6064f Mon Sep 17 00:00:00 2001 From: Amour1688 Date: Tue, 20 Apr 2021 10:38:19 +0800 Subject: [PATCH] chore: `enableObjectSlots` of `@vue/babel-plugin-jsx` should be false --- antd-tools/getBabelCommonConfig.js | 2 +- antd-tools/getWebpackConfig.js | 5 ++++- webpack.config.js | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/antd-tools/getBabelCommonConfig.js b/antd-tools/getBabelCommonConfig.js index 1f9a97cca..20f5fa70d 100644 --- a/antd-tools/getBabelCommonConfig.js +++ b/antd-tools/getBabelCommonConfig.js @@ -8,7 +8,7 @@ module.exports = function(modules) { isTSX: true, }, ], - [resolve('@vue/babel-plugin-jsx'), { mergeProps: false }], + [resolve('@vue/babel-plugin-jsx'), { mergeProps: false, enableObjectSlots: false }], resolve('@babel/plugin-proposal-optional-chaining'), resolve('@babel/plugin-transform-object-assign'), resolve('@babel/plugin-proposal-object-rest-spread'), diff --git a/antd-tools/getWebpackConfig.js b/antd-tools/getWebpackConfig.js index c3dee7af9..e73392192 100644 --- a/antd-tools/getWebpackConfig.js +++ b/antd-tools/getWebpackConfig.js @@ -97,7 +97,10 @@ function getWebpackConfig(modules) { options: { presets: [resolve('@babel/preset-env')], plugins: [ - [resolve('@vue/babel-plugin-jsx'), { mergeProps: false }], + [ + resolve('@vue/babel-plugin-jsx'), + { mergeProps: false, enableObjectSlots: false }, + ], resolve('@babel/plugin-proposal-object-rest-spread'), ], }, diff --git a/webpack.config.js b/webpack.config.js index 0fbc8e475..c394352b8 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -33,7 +33,7 @@ const babelConfig = { style: true, }, ], - ['@vue/babel-plugin-jsx', { mergeProps: false }], + ['@vue/babel-plugin-jsx', { mergeProps: false, enableObjectSlots: false }], '@babel/plugin-proposal-optional-chaining', '@babel/plugin-transform-object-assign', '@babel/plugin-proposal-object-rest-spread',