Skip to content

Commit

Permalink
fix(babel-preset-gatsby): Add corejs to config (#12781)
Browse files Browse the repository at this point in the history
* Add corejs to babel-preset-gatsby's config
Fixes #12744

* bump @babel/preset-env to 7.4.1 to allow corejs config value
  • Loading branch information
erikdstock authored and KyleAMathews committed Mar 23, 2019
1 parent c248734 commit 4b49da1
Show file tree
Hide file tree
Showing 4 changed files with 336 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/babel-preset-gatsby/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"@babel/plugin-proposal-class-properties": "^7.0.0",
"@babel/plugin-syntax-dynamic-import": "^7.0.0",
"@babel/plugin-transform-runtime": "^7.0.0",
"@babel/preset-env": "^7.0.0",
"@babel/preset-env": "^7.4.1",
"@babel/preset-react": "^7.0.0",
"babel-plugin-macros": "^2.4.2"
},
Expand Down
3 changes: 3 additions & 0 deletions packages/babel-preset-gatsby/src/__tests__/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ it(`Specifies proper presets and plugins for test stage`, () => {
[
expect.stringContaining(path.join(`@babel`, `preset-env`)),
{
corejs: 2,
loose: true,
modules: `commonjs`,
useBuiltIns: `usage`,
Expand Down Expand Up @@ -62,6 +63,7 @@ it(`Specifies proper presets and plugins for build-html stage`, () => {
[
expect.stringContaining(path.join(`@babel`, `preset-env`)),
{
corejs: 2,
loose: true,
modules: false,
useBuiltIns: `usage`,
Expand Down Expand Up @@ -109,6 +111,7 @@ it(`Allows to configure browser targets`, () => {
expect(presets[0]).toEqual([
expect.stringContaining(path.join(`@babel`, `preset-env`)),
{
corejs: 2,
loose: true,
modules: false,
useBuiltIns: `usage`,
Expand Down
1 change: 1 addition & 0 deletions packages/babel-preset-gatsby/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ module.exports = function preset(_, options = {}) {
[
resolve(`@babel/preset-env`),
{
corejs: 2,
loose: true,
modules: stage === `test` ? `commonjs` : false,
useBuiltIns: `usage`,
Expand Down
Loading

0 comments on commit 4b49da1

Please sign in to comment.