1.0.0 • Published 4 years ago
uno-h5 v1.0.0
React Single-page-application Template
A single page react project template.
Overview
react-spa-template
├── README.md
├── node_modules
├── package.json
├── .gitignore
├── .babelrc
├── .browserlistrc
├── .eslintrc
├── dist
│ ├── js
│ ├── index.html
│ └── stats.html
└── src
├── assets // static resource
├── components // react components
├── containers // specify a container for every page
├── core
|-- App.jsx // application's root element, bootstrap the application
├── redux // specify actions, reducers and action-constant
├── services // handle requests with server
├── routes // specify routes
└── templates
└── index.html // js resources will be injected to the html
Get Started
git clone https://github.com/vivimee/react-spa-template.git my-app
cd my-app
yarn
yarn dev
Add A Page
- Add a container in /src/containers
- Import the container in /src/routes/index.js
- Specify a route
const Homepage = Loadable({
loader: () => import(/* webpackChunkName: "home-page" */'../containers/Homepage'),
});
<Route exact path="/" component={Homepage} />
Build For Production
yarn build
Deploy To Server
- update
/scripts/publish.js
yarn publish
1.0.0
4 years ago