Skip to content

Commit

Permalink
Add a temporary fix for generators (#262)
Browse files Browse the repository at this point in the history
This enables us to ship them now, and find a way to resolve runtime path without webpack later.
See #255
  • Loading branch information
gaearon authored Jul 28, 2016
1 parent 29c913e commit 9dab871
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
11 changes: 11 additions & 0 deletions config/webpack.config.dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
11 changes: 11 additions & 0 deletions config/webpack.config.prod.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 9dab871

Please sign in to comment.