Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix build for Gatsby (WebPack v1). #1107

Merged
merged 1 commit into from
Feb 21, 2018
Merged

Fix build for Gatsby (WebPack v1). #1107

merged 1 commit into from
Feb 21, 2018

Conversation

tech4him1
Copy link
Contributor

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 isn't something we want to do permanently, as packages should be able to do this themselves. We do have a lot of Gatsby users, though, so this is a temporary fix for now.

Closes #1097.

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.
@verythorough
Copy link
Contributor

Deploy preview for netlify-cms-www ready!

Built with commit 8d74a32

https://deploy-preview-1107--netlify-cms-www.netlify.com

@verythorough
Copy link
Contributor

Deploy preview for cms-demo ready!

Built with commit 8d74a32

https://deploy-preview-1107--cms-demo.netlify.com

@erquhart
Copy link
Contributor

We should be able to just add our own babel loader for the cms script to Gatsby's webpack. Giving that a shot now, I'll link the PR if it works.

@erquhart
Copy link
Contributor

For posterity, the latest thought is that babel-preset-env may not be such a great fit for distributed packages, where transpilation considerations are less about the end product and more about the tooling of consumers.

It makes sense at the moment to be presciptive about what exactly we're transpiling, which doesn't map to a specific browsers support model.

Merging this PR is the first step, but we may go ahead and remove babel-preset-env entirely in the future, instead using exactly what we need for the desired output.

@erquhart erquhart merged commit f97e2d2 into master Feb 21, 2018
@erquhart erquhart deleted the gatsby-fix branch February 21, 2018 21:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Breaking: gatsby-plugin-netlify-cms broken since #765.
3 participants