Skip to content

Commit

Permalink
fix transform-classes
Browse files Browse the repository at this point in the history
  • Loading branch information
wardpeet committed Feb 5, 2021
1 parent ab570eb commit 67158bd
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 773 deletions.
1 change: 1 addition & 0 deletions packages/babel-preset-gatsby/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"@babel/plugin-proposal-nullish-coalescing-operator": "^7.12.1",
"@babel/plugin-proposal-optional-chaining": "^7.12.1",
"@babel/plugin-syntax-dynamic-import": "^7.8.3",
"@babel/plugin-transform-classes": "^7.12.1",
"@babel/plugin-transform-runtime": "^7.12.1",
"@babel/plugin-transform-spread": "^7.12.1",
"@babel/preset-env": "^7.12.1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,12 @@ Object {
"loose": false,
},
],
Array [
"<PROJECT_ROOT>/node_modules/@babel/plugin-transform-classes/lib/index.js",
Object {
"loose": true,
},
],
"<PROJECT_ROOT>/node_modules/babel-plugin-dynamic-import-node/lib/index.js",
Array [
"<PROJECT_ROOT>/node_modules/babel-plugin-transform-react-remove-prop-types/lib/index.js",
Expand Down Expand Up @@ -568,6 +574,12 @@ Object {
"loose": false,
},
],
Array [
"<PROJECT_ROOT>/node_modules/@babel/plugin-transform-classes/lib/index.js",
Object {
"loose": true,
},
],
"<PROJECT_ROOT>/node_modules/babel-plugin-dynamic-import-node/lib/index.js",
],
"presets": Array [
Expand Down
7 changes: 7 additions & 0 deletions packages/babel-preset-gatsby/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,12 +119,19 @@ export default function preset(_, options = {}) {
// absoluteRuntime: absoluteRuntimePath,
},
],
// TODO allow loose mode as an option in v3
isBrowser && [
resolve(`@babel/plugin-transform-spread`),
{
loose: false, // Fixes #14848
},
],
isBrowser && [
resolve(`@babel/plugin-transform-classes`),
{
loose: true,
},
],
IS_TEST && resolve(`babel-plugin-dynamic-import-node`),
stage === `build-javascript` && [
// Remove PropTypes from production build
Expand Down

0 comments on commit 67158bd

Please sign in to comment.