Commit 9dab8715 authored by Dan Abramov's avatar Dan Abramov Committed by GitHub
Browse files

Add a temporary fix for generators (#262)

This enables us to ship them now, and find a way to resolve runtime path without webpack later.
See https://github.com/facebookincubator/create-react-app/issues/255
parent 29c913e9
No related merge requests found
Showing with 22 additions and 0 deletions
+22 -0
......@@ -30,6 +30,17 @@ module.exports = {
},
resolve: {
extensions: ['', '.js', '.json'],
alias: {
// This `alias` section can be safely removed after ejection.
// We do this because `babel-runtime` may be inside `react-scripts`,
// so when `babel-plugin-transform-runtime` imports it, it will not be
// available to the app directly. This is a temporary solution that lets
// us ship support for generators. However it is far from ideal, and
// if we don't have a good solution, we should just make `babel-runtime`
// a dependency in generated projects.
// See https://github.com/facebookincubator/create-react-app/issues/255
'babel-runtime/regenerator': require.resolve('babel-runtime/regenerator')
}
},
resolveLoader: {
root: paths.ownNodeModules,
......
......@@ -37,6 +37,17 @@ module.exports = {
},
resolve: {
extensions: ['', '.js', '.json'],
alias: {
// This `alias` section can be safely removed after ejection.
// We do this because `babel-runtime` may be inside `react-scripts`,
// so when `babel-plugin-transform-runtime` imports it, it will not be
// available to the app directly. This is a temporary solution that lets
// us ship support for generators. However it is far from ideal, and
// if we don't have a good solution, we should just make `babel-runtime`
// a dependency in generated projects.
// See https://github.com/facebookincubator/create-react-app/issues/255
'babel-runtime/regenerator': require.resolve('babel-runtime/regenerator')
}
},
resolveLoader: {
root: paths.ownNodeModules,
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment