File tree Expand file tree Collapse file tree 6 files changed +35
-17
lines changed Expand file tree Collapse file tree 6 files changed +35
-17
lines changed File renamed without changes.
Original file line number Diff line number Diff line change 44 "description" : " " ,
55 "main" : " index.js" ,
66 "scripts" : {
7- "start" : " babel-node app/app .js --ignore 'node_modules/' || exit 0" ,
7+ "start" : " babel-node app/server .js --ignore 'node_modules/' || exit 0" ,
88 "test" : " echo \" Error: no test specified\" && exit 1"
99 },
1010 "keywords" : [],
2222 },
2323 "dependencies" : {
2424 "babel-preset-es2015" : " ^6.13.2" ,
25+ "babel-preset-react" : " ^6.11.1" ,
2526 "body-parser" : " ^1.15.2" ,
26- "express" : " ^4.14.0"
27+ "express" : " ^4.14.0" ,
28+ "jquery" : " ^3.1.0" ,
29+ "lodash" : " ^4.14.1" ,
30+ "react" : " ^15.3.0" ,
31+ "react-dom" : " ^15.3.0"
2732 }
2833}
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1+ import Hello from './hello.jsx' ;
2+ import React from 'react' ;
3+ import ReactDOM from 'react-dom' ;
4+
5+ ReactDOM . render (
6+ < Hello /> ,
7+ document . getElementById ( "content" )
8+ ) ;
9+
10+ // Notice!!!
11+ // Following is required to make reloading happen
12+ if ( module . hot ) {
13+ module . hot . accept ( ) ;
14+ }
Original file line number Diff line number Diff line change 1+ import React from 'react' ;
2+
3+ class Hello extends React . Component {
4+ render ( ) {
5+ return ( < div >
6+ < h1 > Hello world</ h1 >
7+ </ div > )
8+ }
9+ }
10+
11+ export default Hello ;
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ const webpack = require('webpack');
22
33module . exports = {
44 entry : [
5- './public/entry.js ' ,
5+ './public/entry.jsx ' ,
66 'webpack-hot-middleware/client'
77 ] ,
88 output : {
@@ -12,11 +12,11 @@ module.exports = {
1212 } ,
1313 module : {
1414 loaders : [ {
15- test : / \. j s $ / ,
15+ test : / \. ( j s | j s x ) $ / ,
1616 exclude : / n o d e _ m o d u l e s / ,
1717 loader : 'babel' ,
1818 query : {
19- presets : [ 'es2015' ]
19+ presets : [ 'es2015' , 'react' ]
2020 }
2121 } ]
2222 } ,
You can’t perform that action at this time.
0 commit comments