Skip to content

Commit f9f476f

Browse files
committed
Lesson 01
0 parents  commit f9f476f

File tree

5 files changed

+59
-0
lines changed

5 files changed

+59
-0
lines changed

index.html

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<!doctype html public="storage">
2+
<html>
3+
<meta charset=utf-8/>
4+
<title>My First React Router App</title>
5+
<div id=app></div>
6+
<script src="bundle.js"></script>
7+

index.js

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
import React from 'react'
2+
import { render } from 'react-dom'
3+
import App from './modules/App'
4+
render(<App/>, document.getElementById('app'))

modules/App.js

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import React from 'react'
2+
3+
export default React.createClass({
4+
render() {
5+
return <div>Hello, React Router!</div>
6+
}
7+
})
8+

package.json

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"name": "tutorial",
3+
"version": "1.0.0",
4+
"description": "",
5+
"main": "index.js",
6+
"scripts": {
7+
"start": "webpack-dev-server --inline --content-base ."
8+
},
9+
"author": "",
10+
"license": "ISC",
11+
"dependencies": {
12+
"react": "^0.14.7",
13+
"react-dom": "^0.14.7",
14+
"react-router": "^2.0.0-rc6"
15+
},
16+
"devDependencies": {
17+
"babel-core": "^6.5.1",
18+
"babel-loader": "^6.2.2",
19+
"babel-preset-es2015": "^6.5.0",
20+
"babel-preset-react": "^6.5.0",
21+
"http-server": "^0.8.5",
22+
"webpack": "^1.12.13",
23+
"webpack-dev-server": "^1.14.1"
24+
}
25+
}

webpack.config.js

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
module.exports = {
2+
entry: './index.js',
3+
4+
output: {
5+
filename: 'bundle.js',
6+
publicPath: ''
7+
},
8+
9+
module: {
10+
loaders: [
11+
{ test: /\.js$/, exclude: /node_modules/, loader: 'babel-loader?presets[]=es2015&presets[]=react' }
12+
]
13+
}
14+
}
15+

0 commit comments

Comments
 (0)