Created
May 7, 2015 05:23
-
-
Save luchoching/a865e5fc29503859f7a7 to your computer and use it in GitHub Desktop.
ES6 + react + webpack
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import Hello from './components/Hello.jsx'; | |
React.render(<Hello />, document.getElementById('app')); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
. | |
├── css | |
├── index.html | |
├── js | |
├── node_modules | |
├── package.json | |
├── README.md | |
└── webpack.config.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
let Hello = React.createClass({ | |
render(){ | |
return( | |
<div> | |
<h1>Hello 贊啦!!</h1> | |
</div> | |
); | |
} | |
}); | |
export default Hello; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="zh"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>New React App</title> | |
</head> | |
<body> | |
<section id="app"></section> | |
<script type="text/javascript" src="bundle.js"></script> | |
</body> | |
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "ES6React", | |
"version": "0.0.0", | |
"description": "ES6 + react + webpack", | |
"scripts": { | |
"start": "webpack-dev-server --hot --progress --colors", | |
"build": "webpack --progress --colors" | |
}, | |
"devDependencies": { | |
"babel-core": "^5.2.16", | |
"babel-loader": "^5.0.0", | |
"react": "^0.13.2", | |
"react-hot-loader": "^1.2.7", | |
"webpack": "^1.8.11", | |
"webpack-dev-server": "^1.8.2" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment