Skip to content

Commit 272ba4f

Browse files
Js-Brechtgatsbybot
andauthored
fix(babel-preset-gatsby-package): remove explicit @babel/plugin-proposal-class-properties and let @babel/preset-env add it (#24640)
* fix error from babel about `loose: true` * update snapshots for tests * remove @babel/plugin-proposal-class-properties * update jest snapshots * remove class-properties from dependencies Co-authored-by: gatsbybot <mathews.kyle+gatsbybot@gmail.com>
1 parent c3ecb22 commit 272ba4f

File tree

3 files changed

+2
-6
lines changed

3 files changed

+2
-6
lines changed

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ Array [
5454

5555
exports[`babel-preset-gatsby-package in browser mode specifies the proper plugins 1`] = `
5656
Array [
57-
"@babel/plugin-proposal-class-properties",
5857
"@babel/plugin-proposal-nullish-coalescing-operator",
5958
"@babel/plugin-proposal-optional-chaining",
6059
"@babel/plugin-transform-runtime",
@@ -111,7 +110,6 @@ Array [
111110

112111
exports[`babel-preset-gatsby-package in node mode specifies the proper plugins 1`] = `
113112
Array [
114-
"@babel/plugin-proposal-class-properties",
115113
"@babel/plugin-proposal-nullish-coalescing-operator",
116114
"@babel/plugin-proposal-optional-chaining",
117115
"@babel/plugin-transform-runtime",

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ function preset(context, options = {}) {
44
const { browser = false, debug = false, nodeVersion = `10.13.0` } = options
55
const { NODE_ENV, BABEL_ENV } = process.env
66

7-
const IS_TEST = (BABEL_ENV || NODE_ENV) === `test`
7+
const IS_TEST = (BABEL_ENV || NODE_ENV) === `test`
88

99
const browserConfig = {
1010
useBuiltIns: false,
@@ -39,12 +39,11 @@ function preset(context, options = {}) {
3939
r(`@babel/preset-flow`),
4040
],
4141
plugins: [
42-
r(`@babel/plugin-proposal-class-properties`),
4342
r(`@babel/plugin-proposal-nullish-coalescing-operator`),
4443
r(`@babel/plugin-proposal-optional-chaining`),
4544
r(`@babel/plugin-transform-runtime`),
4645
r(`@babel/plugin-syntax-dynamic-import`),
47-
IS_TEST && r(`babel-plugin-dynamic-import-node`)
46+
IS_TEST && r(`babel-plugin-dynamic-import-node`),
4847
].filter(Boolean),
4948
overrides: [
5049
{

packages/babel-preset-gatsby-package/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
},
1010
"homepage": "https://github.com/gatsbyjs/gatsby/tree/master/packages/babel-preset-gatsby-package#readme",
1111
"dependencies": {
12-
"@babel/plugin-proposal-class-properties": "^7.10.1",
1312
"@babel/plugin-proposal-nullish-coalescing-operator": "^7.10.1",
1413
"@babel/plugin-proposal-optional-chaining": "^7.10.1",
1514
"@babel/plugin-syntax-dynamic-import": "^7.8.3",

0 commit comments

Comments
 (0)