Skip to content

Commit

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

* bump @babel/preset-env to 7.4.1 to allow corejs config value
erikdstock authored and KyleAMathews committed Mar 23, 2019
1 parent c248734 commit 4b49da1
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
@@ -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"
},
3 changes: 3 additions & 0 deletions packages/babel-preset-gatsby/src/__tests__/index.js
Original file line number Diff line number Diff line change
@@ -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`,
@@ -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`,
@@ -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`,
1 change: 1 addition & 0 deletions packages/babel-preset-gatsby/src/index.js
Original file line number Diff line number Diff line change
@@ -45,6 +45,7 @@ module.exports = function preset(_, options = {}) {
[
resolve(`@babel/preset-env`),
{
corejs: 2,
loose: true,
modules: stage === `test` ? `commonjs` : false,
useBuiltIns: `usage`,
Loading

0 comments on commit 4b49da1

Please sign in to comment.