Skip to content

Commit 67158bd

Browse files
committed
fix transform-classes
1 parent ab570eb commit 67158bd

File tree

4 files changed

+44
-773
lines changed

4 files changed

+44
-773
lines changed

packages/babel-preset-gatsby/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
"@babel/plugin-proposal-nullish-coalescing-operator": "^7.12.1",
1414
"@babel/plugin-proposal-optional-chaining": "^7.12.1",
1515
"@babel/plugin-syntax-dynamic-import": "^7.8.3",
16+
"@babel/plugin-transform-classes": "^7.12.1",
1617
"@babel/plugin-transform-runtime": "^7.12.1",
1718
"@babel/plugin-transform-spread": "^7.12.1",
1819
"@babel/preset-env": "^7.12.1",

packages/babel-preset-gatsby/src/__tests__/__snapshots__/index.js.snap

+12
Original file line numberDiff line numberDiff line change
@@ -298,6 +298,12 @@ Object {
298298
"loose": false,
299299
},
300300
],
301+
Array [
302+
"<PROJECT_ROOT>/node_modules/@babel/plugin-transform-classes/lib/index.js",
303+
Object {
304+
"loose": true,
305+
},
306+
],
301307
"<PROJECT_ROOT>/node_modules/babel-plugin-dynamic-import-node/lib/index.js",
302308
Array [
303309
"<PROJECT_ROOT>/node_modules/babel-plugin-transform-react-remove-prop-types/lib/index.js",
@@ -568,6 +574,12 @@ Object {
568574
"loose": false,
569575
},
570576
],
577+
Array [
578+
"<PROJECT_ROOT>/node_modules/@babel/plugin-transform-classes/lib/index.js",
579+
Object {
580+
"loose": true,
581+
},
582+
],
571583
"<PROJECT_ROOT>/node_modules/babel-plugin-dynamic-import-node/lib/index.js",
572584
],
573585
"presets": Array [

packages/babel-preset-gatsby/src/index.js

+7
Original file line numberDiff line numberDiff line change
@@ -119,12 +119,19 @@ export default function preset(_, options = {}) {
119119
// absoluteRuntime: absoluteRuntimePath,
120120
},
121121
],
122+
// TODO allow loose mode as an option in v3
122123
isBrowser && [
123124
resolve(`@babel/plugin-transform-spread`),
124125
{
125126
loose: false, // Fixes #14848
126127
},
127128
],
129+
isBrowser && [
130+
resolve(`@babel/plugin-transform-classes`),
131+
{
132+
loose: true,
133+
},
134+
],
128135
IS_TEST && resolve(`babel-plugin-dynamic-import-node`),
129136
stage === `build-javascript` && [
130137
// Remove PropTypes from production build

0 commit comments

Comments
 (0)