From dae579a88e01d0e01d36f1d61bda03faed7ae92b Mon Sep 17 00:00:00 2001 From: tangjinzhou <415800467@qq.com> Date: Sat, 2 Jul 2022 22:22:01 +0800 Subject: [PATCH] chore: update tools --- antd-tools/getWebpackConfig.js | 3 ++- index.esm.js | 1 + index.js | 4 ++-- 3 files changed, 5 insertions(+), 3 deletions(-) create mode 100644 index.esm.js diff --git a/antd-tools/getWebpackConfig.js b/antd-tools/getWebpackConfig.js index 557ad7b27..d49d234f3 100644 --- a/antd-tools/getWebpackConfig.js +++ b/antd-tools/getWebpackConfig.js @@ -215,7 +215,7 @@ All rights reserved. }; if (process.env.RUN_ENV === 'PRODUCTION') { - const entry = ['./index']; + let entry = ['./index']; config.externals = { vue: { root: 'Vue', @@ -237,6 +237,7 @@ All rights reserved. ], }; if (esm) { + entry = ['./index.esm']; config.experiments = { ...config.experiments, outputModule: true, diff --git a/index.esm.js b/index.esm.js new file mode 100644 index 000000000..07635cbbc --- /dev/null +++ b/index.esm.js @@ -0,0 +1 @@ +export * from './components'; diff --git a/index.js b/index.js index 2504ffa39..bfa504760 100644 --- a/index.js +++ b/index.js @@ -1,3 +1,3 @@ -import './index-style-only'; +require('./index-style-only'); -export * from './components'; +module.exports = require('./components');