Closed
Description
Chatted with @loganfsmyth this afternoon about how best to upgrade Gatsby to v7 of Babel.
Disable reading any .babelrc files — since we load babelrc directly we shouldn't allow babel to go looking for additional babelrc files. I'm not sure how to do this should would appreciate some pointers.Remove stage-0 preset- Potentially add way to opt-out of reading a user's .babelrc file — potentially they could be using Babel v6 for e.g. a test framework. While they haven't upgraded that to v7 of Babel, their .babelrc file would cause conflicts. We were unsure if this would be a real issue or not so we'll probably wait and see if there's problems before adding support for this.
- Logan says Babel is moving towards having more regular releases. One way to loosen the coupling between Gatsby and Babel is to move Gatsby's Babel setup to a package which Gatsby depends on e.g.
gatsby-babel
. When there's a new major version of Babel, we release a new version ofgatsby-babel
that people can optional add as a dependency along with the new version ofbabel-core
. Then when we requiregatsby-babel
we first check if the site has a direct dependency ongatsby-babel
and preferentially use that and fall back on the default version. Once the new version of Babel is stable, on the next major release of Gatsby we'd update ourgatsby-babel
version. - Copy CRA's implementation for compiling
node_modules
with babel-preset-env which will fix problems like "gatsby build" breaks when dependencies use es6 code (which Uglify doesn't support) #3780
/cc @jquense
Metadata
Metadata
Assignees
Labels
No labels