Skip to content

Commit

Permalink
Update babel.config.js so build artifacts are compiled to ES5. (rjsf-…
Browse files Browse the repository at this point in the history
…team#3304)

dts-cli will utilize the babel.config.js file on build. The `targets` option for the @babel/preset-env plugin will determine what features the compiled output will target. Per babel docs:

 > When no targets are specified: Babel will assume you are targeting the oldest browsers possible. For example, @babel/preset-env will transform all ES2015-ES2020 code to be ES5 compatible.

 This approach will allow us to continue to write ESNext code while we can be confident RJSF users will still consume ES5 code.
  • Loading branch information
nickgros authored and shijistar committed Jun 8, 2023
1 parent 449f19b commit d563e9b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -19,6 +19,7 @@ should change the heading of the (upcoming) version to include a major version b

# @rjsf/core
- Pass the `schema` along to the `ArrayFieldItemTemplate` as part of the fix for [#3253](https://github.com/rjsf-team/react-jsonschema-form/issues/3253)
- Tweak Babel configuration to emit ES5-compatible output files, fixing [#3240](https://github.com/rjsf-team/react-jsonschema-form/issues/3240)

# @rjsf/utils
- Update the `ArrayFieldItemTemplate` to add `schema` as part of the fix for [#3253](https://github.com/rjsf-team/react-jsonschema-form/issues/3253)
Expand Down
2 changes: 1 addition & 1 deletion babel.config.js
@@ -1,7 +1,7 @@
const BABEL_ENV = process.env.BABEL_ENV;
const IS_TEST = BABEL_ENV === "test"
const ignore = IS_TEST ? [] : ['test/**/*.js']
const targets = IS_TEST ? { node: "current" } : { browsers: "defaults" }
const targets = IS_TEST ? { node: "current" } : {}

module.exports = {
presets: [
Expand Down

0 comments on commit d563e9b

Please sign in to comment.