0.1.4 • Published 9 years ago
horese-koa v0.1.4
horese-koa
Rise a koa server with hot reloading in dev env, with no conf!
how to build a react project from scratch, with no conf!
create an npm project
mkdir my_project
cd my_project
npm initinstall horese-koa...
npm i --save horese-koa... and React
npm i --save react react-domcreate your first project
add 2 file "src/index.js and "src/app.js"
mkdir src
touch src/index.js
touch src/app.jsthis is the file contents:
src/index.js
import React from 'react';
import ReactDOM from 'react-dom';
import App from './app'
ReactDOM.render(
(<App />),
document.getElementById('react_body')
);src/app.js
import React from 'react';
class App extends React.Component {
render(){
return <div>React Super Simple example with hot reloading and error catch</div>
}
}
export default App;###create the running script on your package .json add:
"scripts": {
...
"dev":"horese-koa-server"
},###run your project
npm run devthat's it! you will have your react project with hotreloading running!. no webpack or babel config!