This repository was archived by the owner on Jan 2, 2018. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2323 ],
2424 "license" : " MIT" ,
2525 "dependencies" : {
26- "roc-plugin-react" : " 1.0.0-beta.1" ,
2726 "babel-plugin-react-transform" : " ~2.0.0" ,
2827 "babel-preset-react" : " ~6.3.13" ,
2928 "react-transform-catch-errors" : " ~1.0.2" ,
Original file line number Diff line number Diff line change 1- import webpack from '../webpack' ;
2-
31export default {
4- plugins : [ require . resolve ( 'roc-plugin-react' ) ] ,
52 config : {
63 settings : {
74 dev : {
@@ -12,8 +9,30 @@ export default {
129 } ,
1310 } ,
1411 actions : [ {
15- hook : 'build-webpack' ,
16- description : 'Adds the needed Webpack configuration to be able to build and develop React code.' ,
17- action : webpack ,
12+ hook : 'babel-config' ,
13+ description : 'Adds the needed Babel configuration to be able to build and develop React code.' ,
14+ action : ( { context : { config } } ) => ( target ) => ( babelConfig ) => {
15+ babelConfig . presets . push ( require . resolve ( 'babel-preset-react' ) ) ;
16+
17+ if ( target === 'web' && config . settings . build . mode === 'dev' ) {
18+ babelConfig . plugins . push ( [
19+ require . resolve ( 'babel-plugin-react-transform' ) , {
20+ transforms : [
21+ {
22+ transform : require . resolve ( 'react-transform-hmr' ) ,
23+ imports : [ 'react' ] ,
24+ locals : [ 'module' ] ,
25+ } ,
26+ {
27+ transform : require . resolve ( 'react-transform-catch-errors' ) ,
28+ imports : [ 'react' , require . resolve ( 'redbox-react' ) ] ,
29+ } ,
30+ ] ,
31+ } ,
32+ ] ) ;
33+ }
34+
35+ return babelConfig ;
36+ } ,
1837 } ] ,
1938} ;
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 2525 "dependencies" : {
2626 "react" : " ~15.0.1" ,
2727 "react-dom" : " ~15.0.1" ,
28- "roc" : " 1.0.0-rc.11 "
28+ "roc" : " ^ 1.0.0-rc.12 "
2929 },
3030 "devDependencies" : {
3131 "babel-eslint" : " ~6.1.2" ,
You can’t perform that action at this time.
0 commit comments