Skip to content

Commit

Permalink
adds error catcher to react-transform
Browse files Browse the repository at this point in the history
makes errors very nice to deal with, shows a red error container
over your app window, much like React native.

https://github.com/gaearon/react-transform-catch-errors
https://github.com/KeywordBrain/redbox-react
  • Loading branch information
AdamBrodzinski committed Sep 5, 2015
1 parent 9e6a666 commit ecc7518
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 16 deletions.
33 changes: 17 additions & 16 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
{
"stage": 0,
"plugins": [
"react-transform"
],
"extra": {
"react-transform": [{
"target": "react-transform-webpack-hmr",

// if you use React Native, pass "react-native" instead:
"imports": ["react"],

// this is important for Webpack HMR:
"locals": ["module"]
}]
// note: you can put more transforms into array
// this is just one of them!
}
"plugins": [
"react-transform"
],
"extra": {
"react-transform": [{
"target": "react-transform-webpack-hmr",
"imports": ["react"],
// this is important for Webpack HMR:
"locals": ["module"]
},
{
"target": "react-transform-catch-errors",
// the second import is the React component to render error
// (it can be a local path too, like "./src/ErrorReporter")
"imports": ["react", "redbox-react"]
}]
}
}
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@
"grunt": "^0.4.5",
"grunt-cli": "^0.1.13",
"node-libs-browser": "^0.5.2",
"react-transform-catch-errors": "^0.1.1",
"react-transform-webpack-hmr": "^0.1.4",
"redbox-react": "^1.0.1",
"style-loader": "^0.12.3",
"webpack": "^1.10.1",
"webpack-dev-server": "^1.10.1"
Expand Down

0 comments on commit ecc7518

Please sign in to comment.