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 5328917
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 44,254 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.
},
};
Loading

0 comments on commit 5328917

Please sign in to comment.