Skip to content

Commit 0d5be92

Browse files
Fix #2962 to properly build esm version for antd (#3044)
- Updated `package*.json` to add `@rollup/plugin-replace` - Added a `dts.config.js` file that caused `antd/lib` and `rc-picker/lib` to be replaced with `antd/es` and `rc-picker/es` - Updated the `CHANGELOG.md` file for the fix
1 parent 1c46492 commit 0d5be92

File tree

4 files changed

+49
-0
lines changed

4 files changed

+49
-0
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ should change the heading of the (upcoming) version to include a major version b
2424
- Fix `ui:field` with anyOf or oneOf no longer rendered twice (#2890)
2525
- **BREAKING CHANGE** Fixed `anyOf` and `oneOf` getting incorrect, potentially duplicate ids when combined with array (https://github.com/rjsf-team/react-jsonschema-form/issues/2197)
2626

27+
## @rjsf/antd
28+
- Fix esm build to use `@rollup/plugin-replace` to replace `antd/lib` and `rc-picker/lib` with `antd/es` and `rc-picker/es` respectively, fixing (https://github.com/rjsf-team/react-jsonschema-form/issues/2962)
29+
2730
## @rjsf/semantic-ui
2831
- Fix missing error class on fields (https://github.com/rjsf-team/react-jsonschema-form/issues/2666)
2932

packages/antd/dts.config.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
const replace = require("@rollup/plugin-replace");
2+
3+
module.exports = {
4+
// This function will run for each entry/format/env combination
5+
rollup(config, options) {
6+
if (options.format === "esm") {
7+
config.plugins.push(
8+
replace({
9+
"antd/lib": "antd/es",
10+
"rc-picker/lib": "rc-picker/es",
11+
})
12+
);
13+
}
14+
return config; // always return a config.
15+
},
16+
};

packages/antd/package-lock.json

Lines changed: 29 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/antd/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@
6262
"@rjsf/core": "^4.2.0",
6363
"@rjsf/utils": "^4.2.0",
6464
"@rjsf/validator-ajv6": "^4.2.0",
65+
"@rollup/plugin-replace": "^4.0.0",
6566
"antd": "^4.22.6",
6667
"atob": "^2.0.3",
6768
"dayjs": "^1.11.5",

0 commit comments

Comments
 (0)