Skip to content

Commit

Permalink
Fix #2962 to properly build esm version for antd
Browse files Browse the repository at this point in the history
- 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
  • Loading branch information
heath-freenome committed Aug 24, 2022
1 parent 1c46492 commit e1434b0
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 0 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ should change the heading of the (upcoming) version to include a major version b
- Fix `ui:field` with anyOf or oneOf no longer rendered twice (#2890)
- **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)

## @rjsf/antd
- 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)

## @rjsf/semantic-ui
- Fix missing error class on fields (https://github.com/rjsf-team/react-jsonschema-form/issues/2666)

Expand Down
16 changes: 16 additions & 0 deletions packages/antd/dts.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
const replace = require("@rollup/plugin-replace");

module.exports = {
// This function will run for each entry/format/env combination
rollup(config, options) {
if (options.format === "esm") {
config.plugins.push(
replace({
"antd/lib": "antd/es",
"rc-picker/lib": "rc-picker/es",
})
);
}
return config; // always return a config.
},
};
29 changes: 29 additions & 0 deletions packages/antd/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions packages/antd/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
"@rjsf/core": "^4.2.0",
"@rjsf/utils": "^4.2.0",
"@rjsf/validator-ajv6": "^4.2.0",
"@rollup/plugin-replace": "^4.0.0",
"antd": "^4.22.6",
"atob": "^2.0.3",
"dayjs": "^1.11.5",
Expand Down

0 comments on commit e1434b0

Please sign in to comment.