From 8f7a6f4058bc0cce2c372d62a846c64471af14d2 Mon Sep 17 00:00:00 2001 From: zoomdong <1344492820@qq.com> Date: Fri, 22 Aug 2025 17:40:12 +0800 Subject: [PATCH] chore: use webpack to bundle umd (#54740) --- .fatherrc.ts | 9 +++++---- package.json | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.fatherrc.ts b/.fatherrc.ts index 7b58ba5f21..2491c16174 100644 --- a/.fatherrc.ts +++ b/.fatherrc.ts @@ -5,14 +5,17 @@ const externalsConfig = { react: { root: 'React', commonjs: 'react', + commonjs2: 'react', }, dayjs: { root: 'dayjs', commonjs: 'dayjs', + commonjs2: 'dayjs', }, 'react-dom': { root: 'ReactDOM', commonjs: 'react-dom', + commonjs2: 'react-dom', }, }; @@ -30,7 +33,6 @@ export default defineConfig({ name: 'antd', sourcemap: true, generateUnminified: true, - bundler: 'utoopack', externals: externalsConfig, output: { path: './dist', @@ -39,13 +41,11 @@ export default defineConfig({ alias: { ...resolveAliasConfig, }, - concatenateModules: true, }, './index-with-locales.js': { name: 'antd', sourcemap: true, generateUnminified: true, - bundler: 'utoopack', externals: externalsConfig, output: { path: './dist', @@ -54,9 +54,10 @@ export default defineConfig({ alias: { ...resolveAliasConfig, }, - concatenateModules: true, }, }, + bundler: 'utoopack', + concatenateModules: true, copy: [ { from: './components/style/reset.css', diff --git a/package.json b/package.json index 8edc8bab20..d9526dff0d 100644 --- a/package.json +++ b/package.json @@ -55,7 +55,7 @@ "deploy": "gh-pages -d _site -b gh-pages -f", "deploy:china-mirror": "git checkout gh-pages && git pull origin gh-pages && git push git@gitee.com:ant-design/ant-design.git gh-pages -f", "predist": "npm run version && npm run token:statistic && npm run token:meta && npm run style", - "dist": "father build", + "dist": "antd-tools run dist", "format": "biome format --write .", "install-react-18": "npm i --no-save --legacy-peer-deps react@18 react-dom@18 @testing-library/react@16", "bun-install-react-18": "bun remove react react-dom @testing-library/react && bun add --no-save react@18 react-dom@18 @testing-library/react@16",