diff --git a/config/webpack.config.dev.js b/config/webpack.config.dev.js index 7224589238f0498c8406139010c467510eb1d39e..949e9465fcd8227820f54b7d9e49c4cb5d89506f 100644 --- a/config/webpack.config.dev.js +++ b/config/webpack.config.dev.js @@ -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, diff --git a/config/webpack.config.prod.js b/config/webpack.config.prod.js index 7ce51f2e29d77c5bc999302111487736be972cb9..e085c274649c3a188280784c421fc07e1241a6d0 100644 --- a/config/webpack.config.prod.js +++ b/config/webpack.config.prod.js @@ -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,