Skip to content

Commit

Permalink
Fix build for Gatsby (WebPack v1).
Browse files Browse the repository at this point in the history
WebPack version 1, which Gatsby is using, has the Acorn parser set to
parse ES6 and lower. The latest version of WebPack supports parsing up
to ES2017 and lower (webpack/lib/Parser.js), but Gatsby isn't using it.
  • Loading branch information
tech4him1 authored and erquhart committed Feb 21, 2018
1 parent 53f6427 commit f97e2d2
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 3 deletions.
7 changes: 6 additions & 1 deletion .babelrc
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,12 @@
]
}
}],
"react"
"react",
/**
* Support WebPack version 1.
*/
"es2016",
"es2017",
],
"plugins": [
"lodash",
Expand Down
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@
"babel-plugin-transform-object-rest-spread": "^6.26.0",
"babel-plugin-transform-runtime": "^6.23.0",
"babel-preset-env": "^1.6.0",
"babel-preset-es2016": "^6.24.1",
"babel-preset-es2017": "^6.24.1",
"babel-preset-react": "^6.23.0",
"babel-runtime": "^6.23.0",
"cross-env": "^5.0.2",
Expand Down
17 changes: 15 additions & 2 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -638,7 +638,7 @@ babel-plugin-syntax-trailing-function-commas@^6.22.0:
version "6.22.0"
resolved "https://registry.yarnpkg.com/babel-plugin-syntax-trailing-function-commas/-/babel-plugin-syntax-trailing-function-commas-6.22.0.tgz#ba0360937f8d06e40180a43fe0d5616fff532cf3"

babel-plugin-transform-async-to-generator@^6.22.0:
babel-plugin-transform-async-to-generator@^6.22.0, babel-plugin-transform-async-to-generator@^6.24.1:
version "6.24.1"
resolved "https://registry.yarnpkg.com/babel-plugin-transform-async-to-generator/-/babel-plugin-transform-async-to-generator-6.24.1.tgz#6536e378aff6cb1d5517ac0e40eb3e9fc8d08761"
dependencies:
Expand Down Expand Up @@ -830,7 +830,7 @@ babel-plugin-transform-es2015-unicode-regex@^6.22.0:
babel-runtime "^6.22.0"
regexpu-core "^2.0.0"

babel-plugin-transform-exponentiation-operator@^6.22.0:
babel-plugin-transform-exponentiation-operator@^6.22.0, babel-plugin-transform-exponentiation-operator@^6.24.1:
version "6.24.1"
resolved "https://registry.yarnpkg.com/babel-plugin-transform-exponentiation-operator/-/babel-plugin-transform-exponentiation-operator-6.24.1.tgz#2ab0c9c7f3098fa48907772bb813fe41e8de3a0e"
dependencies:
Expand Down Expand Up @@ -949,6 +949,19 @@ babel-preset-env@^1.6.0:
invariant "^2.2.2"
semver "^5.3.0"

babel-preset-es2016@^6.24.1:
version "6.24.1"
resolved "https://registry.yarnpkg.com/babel-preset-es2016/-/babel-preset-es2016-6.24.1.tgz#f900bf93e2ebc0d276df9b8ab59724ebfd959f8b"
dependencies:
babel-plugin-transform-exponentiation-operator "^6.24.1"

babel-preset-es2017@^6.24.1:
version "6.24.1"
resolved "https://registry.yarnpkg.com/babel-preset-es2017/-/babel-preset-es2017-6.24.1.tgz#597beadfb9f7f208bcfd8a12e9b2b29b8b2f14d1"
dependencies:
babel-plugin-syntax-trailing-function-commas "^6.22.0"
babel-plugin-transform-async-to-generator "^6.24.1"

babel-preset-flow@^6.23.0:
version "6.23.0"
resolved "https://registry.yarnpkg.com/babel-preset-flow/-/babel-preset-flow-6.23.0.tgz#e71218887085ae9a24b5be4169affb599816c49d"
Expand Down

0 comments on commit f97e2d2

Please sign in to comment.