Skip to content

Commit

Permalink
Gatsby by default will transform Object.assign
Browse files Browse the repository at this point in the history
This is done to support older browsers. Fixes #264
  • Loading branch information
benstepp committed May 8, 2016
1 parent 7537b0a commit db72162
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 10 deletions.
4 changes: 1 addition & 3 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
{
"presets": ['react', 'es2015', 'stage-0'],
"plugins": [
'transform-object-rest-spread'
]
"plugins": []
}
4 changes: 2 additions & 2 deletions lib/utils/babel-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ import resolve from 'babel-core/lib/helpers/resolve'
import fs from 'fs'
import path from 'path'
import json5 from 'json5'
import startsWith from 'lodash/startswith'
import startsWith from 'lodash/startsWith'
import invariant from 'invariant'

const DEFAULT_BABEL_CONFIG = {
presets: ['react', 'es2015', 'stage-0'],
plugins: ['add-module-exports'],
plugins: ['add-module-exports', 'transform-object-assign'],
}

/**
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"babel-core": "^6.8.0",
"babel-loader": "^6.2.4",
"babel-plugin-add-module-exports": "^0.2.0",
"babel-plugin-transform-object-assign": "^6.8.0",
"babel-preset-es2015": "^6.6.0",
"babel-preset-react": "^6.5.0",
"babel-preset-react-hmre": "^1.1.1",
Expand Down
5 changes: 1 addition & 4 deletions test/fixtures/site-with-valid-babelrc/.babelrc
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
{
"presets": ['react', 'es2015', 'stage-0'],
"plugins": [
'transform-object-rest-spread'
]
"presets": ['react', 'es2015', 'stage-0']
}
1 change: 0 additions & 1 deletion test/utils/babel-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ test('fixture can resolve plugins in gatsby directory (crawling up)', t => {

const config = babelConfig(program)
t.truthy(config.presets.length)
t.truthy(config.plugins.length)
})

test('throws error when babelrc is not parseable', t => {
Expand Down

0 comments on commit db72162

Please sign in to comment.