Skip to content

Commit

Permalink
chore(react): use babel runtime on es builds (#9833)
Browse files Browse the repository at this point in the history
* chore(react): use babel runtime on es builds

* Update package.json

* chore: update lockfile

* chore(react): use babel runtime on es5 builds

Co-authored-by: Taylor Jones <taylor.jones826@gmail.com>
Co-authored-by: Taylor Jones <tay1orjones@users.noreply.github.com>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
  • Loading branch information
4 people committed Oct 25, 2021
1 parent 7fe81b5 commit 4c044be
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
"react-dom": "^16.8.6 || ^17.0.1"
},
"dependencies": {
"@babel/runtime": "^7.14.6",
"@carbon/feature-flags": "^0.6.0",
"@carbon/icons-react": "^10.41.0",
"@carbon/telemetry": "0.0.0-alpha.6",
Expand Down
4 changes: 4 additions & 0 deletions packages/react/scripts/env.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ const docgenConfig = {
};

module.exports = () => ({
plugins:
BABEL_ENV === 'es' || BABEL_ENV === 'cjs'
? ['@babel/plugin-transform-runtime']
: undefined,
presets: [
[
require.resolve('@babel/preset-env'),
Expand Down
1 change: 1 addition & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -10308,6 +10308,7 @@ __metadata:
"@babel/plugin-transform-object-assign": ^7.14.5
"@babel/preset-env": ^7.14.7
"@babel/preset-react": ^7.14.5
"@babel/runtime": ^7.14.6
"@carbon/feature-flags": ^0.6.0
"@carbon/icons-react": ^10.41.0
"@carbon/telemetry": 0.0.0-alpha.6
Expand Down

0 comments on commit 4c044be

Please sign in to comment.