Skip to content

Commit

Permalink
Fix rjsf-team#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 3e5138f
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
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) {
config.plugins.push(
replace({
"antd/lib": "antd/es",
"rc-picker/lib": "rc-picker/es",
})
);
}
return config; // always return a config.
},
};
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 3e5138f

Please sign in to comment.