Skip to content

Commit be22b4e

Browse files
committed
Fix react-web start "Uncaught ReferenceError: regeneratorRuntime is not defined" by https://babeljs.io/docs/usage/polyfill/
1 parent 0bdd163 commit be22b4e

File tree

3 files changed

+4
-1
lines changed

3 files changed

+4
-1
lines changed

index.web.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React from 'react';
1+
import 'babel-polyfill';
22
import {AppRegistry} from 'react-native';
33
import Noder from './src';
44

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
"devDependencies": {
4747
"babel-eslint": "^6.1.0",
4848
"babel-loader": "^6.2.4",
49+
"babel-polyfill": "^6.13.0",
4950
"babel-preset-es2015": "^6.6.0",
5051
"babel-preset-react": "^6.5.0",
5152
"babel-preset-stage-1": "^6.5.0",

web/webpack.config.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,10 @@ module.exports = {
3131
extensions: ['', '.js', '.jsx'],
3232
},
3333
entry: isProd? [
34+
'babel-polyfill',
3435
config.paths.index
3536
]: [
37+
'babel-polyfill',
3638
'webpack-dev-server/client?http://' + IP + ':' + PORT,
3739
'webpack/hot/only-dev-server',
3840
config.paths.index,

0 commit comments

Comments
 (0)