-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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
Support user provided babel configs #279
Conversation
This change allows the user to provide a babelrc or a babel section in their package.json. It also allows gatsby to be used without having to specifiy a babelrc if the user doesn't need anything past what babel provides as a default. * It resolves all of the paths to become absolute such that the user can crawl upwards as in gatsbyjs#239. * It allows the custom usage of other babel plugins so that decorators work as in gatsbyjs#129.
This is done to support older browsers. Fixes gatsbyjs#264
This will better support versions of npm that do not provide a flat dependency structure
Updates the readme to describe the new behavior of Babel and Gatsby.
Alright, I'm fairly happy with how this turned out. Some highlights:
|
This is impressive stuff! Way better than what I kludged together! I really like how you've emulated the normal Babel behavior for users. That's exactly how I envision Gatsby working — magic out-of-box awesomesauce experience but can override/extend it just like you would a normal React/Webpack app. I'll have some more time tomorrow evening to thoroughly review this + merge and cut new release. |
|
||
const name = !startsWith(pluginName, 'babel') ? pluginName : `babel-${type}-${pluginName}` | ||
const pluginInvariantMessage = ` | ||
You are trying to use a babel plugin which gatsby cannot find. You |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Capitalize Gatsby here and below.
looking good! |
When refering to the main package: * Gatsby is always capitalized * Babel is always capitalized * webpack is always lowercase When refering to an npm package by name, the name becomes lowercase: * babel-loader * json5 * babel-type-* When refering to a specific file it is lowercase: * package.json * .babelrc
Now that the babel config is resolved externally so that it can be stubbed out and tested, webpack.config.js does not know how to change the loader based on the stage.
Support user provided babel configs Conflicts: lib/utils/webpack.config.js package.json
Merged! Will release 0.11 in the morning. |
This change allows the user to provide a babelrc or a babel section in
their package.json. It also allows gatsby to be used without having to
specifiy a babelrc if the user doesn't need anything past what babel
provides as a default.
crawl upwards as in post-build.js should be moved into gatsby-node.js #239.
work as in Decorators causes Gatsby to crash #129.