From 8d5762066b694af4be1a29b152061126abdf920a Mon Sep 17 00:00:00 2001 From: Amour1688 Date: Tue, 11 Aug 2020 19:56:28 +0800 Subject: [PATCH] chore: update compile scripts --- antd-tools/getBabelCommonConfig.js | 1 + antd-tools/getWebpackConfig.js | 8 +++++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/antd-tools/getBabelCommonConfig.js b/antd-tools/getBabelCommonConfig.js index 51f8ccd0e..dd17871a5 100644 --- a/antd-tools/getBabelCommonConfig.js +++ b/antd-tools/getBabelCommonConfig.js @@ -2,6 +2,7 @@ module.exports = function(modules) { const plugins = [ + require.resolve('@ant-design-vue/babel-plugin-jsx'), require.resolve('babel-plugin-inline-import-data-uri'), require.resolve('@babel/plugin-transform-member-expression-literals'), require.resolve('@babel/plugin-transform-property-literals'), diff --git a/antd-tools/getWebpackConfig.js b/antd-tools/getWebpackConfig.js index 4d46ccc73..b2f133d32 100644 --- a/antd-tools/getWebpackConfig.js +++ b/antd-tools/getWebpackConfig.js @@ -50,7 +50,6 @@ function getWebpackConfig(modules) { modules: ['node_modules', path.join(__dirname, '../node_modules')], extensions: ['.js', '.jsx', '.vue', '.md', '.json'], alias: { - vue$: 'vue/dist/vue.esm.js', '@': process.cwd(), }, }, @@ -83,8 +82,11 @@ function getWebpackConfig(modules) { { loader: 'babel-loader', options: { - presets: ['env'], - plugins: ['transform-vue-jsx', 'transform-object-rest-spread'], + presets: [require.resolve('@babel/preset-env')], + plugins: [ + require.resolve('@ant-design-vue/babel-plugin-jsx'), + require.resolve('@babel/plugin-proposal-object-rest-spread'), + ], }, }, ],