-
Notifications
You must be signed in to change notification settings - Fork 10.3k
Closed
Description
Hi. I added async/await support to my Gatsby project by adding this to gatsby-node.js:
exports.modifyWebpackConfig = function(config, env) {
if (env === 'build-javascript' || env === 'develop') {
const previous = config.resolve().entry
config._config.entry = []
config.merge({
entry: ['babel-polyfill'].concat(previous)
})
}
return config
}
And by installing the polyfill package:
npm install --save babel-polyfill
I guess this could be some kind of default in Gatsby to avoid manually messing with the entry array order.
creotip
Metadata
Metadata
Assignees
Labels
No labels