Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: delete webpack.config.js #229

Draft
wants to merge 11 commits into
base: main
Choose a base branch
from
25 changes: 16 additions & 9 deletions .fatherrc.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,12 @@
import { codecovWebpackPlugin } from '@codecov/webpack-plugin';
import DuplicatePackageCheckerPlugin from '@madccc/duplicate-package-checker-webpack-plugin';
import CircularDependencyPlugin from 'circular-dependency-plugin';
import { defineConfig } from 'father';

class CodecovWebpackPlugin {
private options;
constructor(options = {}) {
this.options = {
enableBundleAnalysis: true,
bundleName: 'webpack-bundle',
gitService: 'github',
disable: false,
...options,
};
this.options = options;
}
apply(compiler: any) {
return codecovWebpackPlugin(this.options).apply(compiler);
Expand Down Expand Up @@ -45,8 +41,8 @@ export default defineConfig({
'@ant-design/cssinjs': 'antdCssinjs',
antd: 'antd',
},
chainWebpack: (memo) => {
if (process.env.NODE_ENV === 'production') {
chainWebpack: (memo, { env }) => {
if (env === 'production') {
memo.plugin('codecov').use(CodecovWebpackPlugin, [
{
enableBundleAnalysis: true,
Expand All @@ -55,6 +51,17 @@ export default defineConfig({
gitService: 'github',
},
]);
memo.plugin('circular-dependency-checker').use(CircularDependencyPlugin, [
{
failOnError: true,
},
]);
memo.plugin('duplicate-package-checker').use(DuplicatePackageCheckerPlugin, [
{
verbose: true,
emitError: true,
},
]);
}
return memo;
},
Expand Down
10 changes: 2 additions & 8 deletions docs/react/contributing.en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,17 +88,11 @@ runs the complete test suite. (Make sure the `NODE_ENV` environment variable is

<InstallDependencies npm='$ npm test' yarn='$ yarn test'></InstallDependencies>

### Compile

compiles TypeScript code to the `lib` and `es` directory.

<InstallDependencies npm='$ npm run compile' yarn='$ yarn compile'></InstallDependencies>

### Build

creates UMD build of antd.
Build TypeScript code to the `lib` and `es` directory, creates UMD build of antdx.

<InstallDependencies npm='$ npm run dist' yarn='$ yarn dist'></InstallDependencies>
<InstallDependencies npm='$ npm run compile' yarn='$ yarn compile'></InstallDependencies>

## Development Tools

Expand Down
8 changes: 1 addition & 7 deletions docs/react/contributing.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,16 +90,10 @@ Ant Design 团队会关注所有的 pull request,我们会 review 以及合并

### 编译

编译 TypeScript 代码到 lib 和 es 目录。
编译 TypeScript 代码到 lib 和 es 目录,UMD 版本到 dist 目录

<InstallDependencies npm='$ npm run compile' yarn='$ yarn compile'></InstallDependencies>

### 构建

构建 antd 的 UMD 版本到 dist 目录。

<InstallDependencies npm='$ npm run dist' yarn='$ yarn dist'></InstallDependencies>

## 配套开发工具

- CSS-in-JS 样式提示插件:https://marketplace.visualstudio.com/items?itemName=shezhangzhang.antd-design-token
Expand Down
4 changes: 0 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
"scripts": {
"api-collection": "antd-tools run api-collection",
"authors": "tsx scripts/generate-authors.ts",
"legacy_build": "npm run compile && NODE_OPTIONS='--max-old-space-size=4096' npm run dist",
"changelog": "npm run lint:changelog && tsx scripts/print-changelog.ts",
"check-commit": "tsx scripts/check-commit.ts",
"clean": "antd-tools run clean && rm -rf es lib coverage locale dist report.html artifacts.zip oss-artifacts.zip",
Expand All @@ -46,9 +45,6 @@
"predeploy": "npm run site && cp CNAME _site",
"deploy": "gh-pages -d _site -b gh-pages -f",
"predist": "npm run version && npm run token:statistic && npm run token:meta",
"legacy_dist": "antd-tools run dist",
"legacy_dist:esbuild": "ESBUILD=true npm run dist",
"legacy_dist:esbuild-no-dup-check": "ESBUILD=true NO_DUP_CHECK=true npm run dist",
"format": "biome format --write .",
"prelint": "dumi setup",
"lint": "npm run version && npm run tsc && npm run lint:script && npm run lint:md && npm run lint:style && npm run lint:changelog",
Expand Down
78 changes: 0 additions & 78 deletions webpack.config.js

This file was deleted.

Loading