Skip to content

Commit

Permalink
fix(babel-preset-gatsby): Ensure the spread operator works (#15172)
Browse files Browse the repository at this point in the history
  • Loading branch information
circlingthesun authored and wardpeet committed Jul 12, 2019
1 parent 3c5a45c commit bd07262
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
12 changes: 12 additions & 0 deletions packages/babel-preset-gatsby/src/__tests__/index.js
Expand Up @@ -50,6 +50,12 @@ it(`Specifies proper presets and plugins for test stage`, () => {
useESModules: false,
},
],
[
expect.stringContaining(path.join(`@babel`, `plugin-transform-spread`)),
{
loose: false,
},
],
])
})

Expand Down Expand Up @@ -111,6 +117,12 @@ it(`Specifies proper presets and plugins for build-html stage`, () => {
useESModules: true,
},
],
[
expect.stringContaining(path.join(`@babel`, `plugin-transform-spread`)),
{
loose: false,
},
],
])
})

Expand Down
6 changes: 6 additions & 0 deletions packages/babel-preset-gatsby/src/index.js
Expand Up @@ -85,6 +85,12 @@ module.exports = function preset(_, options = {}) {
absoluteRuntimePath,
},
],
[
resolve(`@babel/plugin-transform-spread`),
{
loose: false, // Fixes #14848
},
],
],
}
}

0 comments on commit bd07262

Please sign in to comment.