Fix build for Gatsby (WebPack v1).

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.
This commit is contained in:
Caleb 2018-02-14 12:49:47 -07:00 committed by Shawn Erquhart
parent 53f6427a26
commit f97e2d2853
3 changed files with 23 additions and 3 deletions

View File

@ -14,7 +14,12 @@
] ]
} }
}], }],
"react" "react",
/**
* Support WebPack version 1.
*/
"es2016",
"es2017",
], ],
"plugins": [ "plugins": [
"lodash", "lodash",

View File

@ -85,6 +85,8 @@
"babel-plugin-transform-object-rest-spread": "^6.26.0", "babel-plugin-transform-object-rest-spread": "^6.26.0",
"babel-plugin-transform-runtime": "^6.23.0", "babel-plugin-transform-runtime": "^6.23.0",
"babel-preset-env": "^1.6.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-preset-react": "^6.23.0",
"babel-runtime": "^6.23.0", "babel-runtime": "^6.23.0",
"cross-env": "^5.0.2", "cross-env": "^5.0.2",

View File

@ -638,7 +638,7 @@ babel-plugin-syntax-trailing-function-commas@^6.22.0:
version "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" 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" 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" resolved "https://registry.yarnpkg.com/babel-plugin-transform-async-to-generator/-/babel-plugin-transform-async-to-generator-6.24.1.tgz#6536e378aff6cb1d5517ac0e40eb3e9fc8d08761"
dependencies: dependencies:
@ -830,7 +830,7 @@ babel-plugin-transform-es2015-unicode-regex@^6.22.0:
babel-runtime "^6.22.0" babel-runtime "^6.22.0"
regexpu-core "^2.0.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" version "6.24.1"
resolved "https://registry.yarnpkg.com/babel-plugin-transform-exponentiation-operator/-/babel-plugin-transform-exponentiation-operator-6.24.1.tgz#2ab0c9c7f3098fa48907772bb813fe41e8de3a0e" resolved "https://registry.yarnpkg.com/babel-plugin-transform-exponentiation-operator/-/babel-plugin-transform-exponentiation-operator-6.24.1.tgz#2ab0c9c7f3098fa48907772bb813fe41e8de3a0e"
dependencies: dependencies:
@ -949,6 +949,19 @@ babel-preset-env@^1.6.0:
invariant "^2.2.2" invariant "^2.2.2"
semver "^5.3.0" 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: babel-preset-flow@^6.23.0:
version "6.23.0" version "6.23.0"
resolved "https://registry.yarnpkg.com/babel-preset-flow/-/babel-preset-flow-6.23.0.tgz#e71218887085ae9a24b5be4169affb599816c49d" resolved "https://registry.yarnpkg.com/babel-preset-flow/-/babel-preset-flow-6.23.0.tgz#e71218887085ae9a24b5be4169affb599816c49d"