-
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
ES7 async/await support #341
Comments
Hmmm... yeah normally you'd just import something like this at the top of your entry file but since Gatsby controls that you need to do this. That being said, this is exactly why Thoughts @kennu and others? |
The ugly part seems to be in getting babel-polyfill to the beginning of the entry array. I couldn't figure out a way to do it without manually resetting Also, I got some errors if I tweaked config._config.entry in other env stages than build-javascript and develop. Not quite sure why. |
Perhaps the "config as a function" option would be cleaner? https://www.npmjs.com/package/webpack-configurator But yeah, more examples of doing stuff like this with webpack-configurator would be +++ |
So all you need is
|
I wasn't quite sure if you can just bypass |
hi, i am a little confused with how to add babel-polyfill to gatsby v 1 config.loader('js', {
test: /\.(js|jsx)$/,
exclude: /(node_modules|bower_components)/,
loader: 'babel-polyfill',
}); doesnt work it gives
|
do you solve this problem? @peonmodel |
i have no idea but it works now...
i havent updated gatsby for sometime, still using v1.0.0
i added
```js
import 'regenerator-runtime/runtime';
```
to the files using async-await
…On Mon, Dec 18, 2017 at 12:35 AM, Zhong Qin ***@***.***> wrote:
do you solve this problem? @peonmodel <https://github.com/peonmodel>
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#341 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AMDzUw7rjqKf-GQNF7dySlM88yZ70e90ks5tBULIgaJpZM4I_Tsu>
.
|
Does Gatsby support modifying the babel settings? I've tried all of the above suggestions to no avail, and I can find no documentation on how to add support for generators or async/await. Being able to modify babel settings is a dealbreaker for me personally. Are there any plans to allow people to customize these settings, and document them? Thanks, |
Yes, you can modify it in 3 ways:
|
Similar issue and solution at #3931 (comment) |
Hi. I added async/await support to my Gatsby project by adding this to
gatsby-node.js
:And by installing the polyfill package:
I guess this could be some kind of default in Gatsby to avoid manually messing with the entry array order.
(Tweeted about it as @kfalck, I'm also @kennu on Twitter.)
The text was updated successfully, but these errors were encountered: