1.43.3 • Published 3 years ago
ilearn-web v1.43.3
Compal iCare - Web (
https://img.shields.io/endpoint?url=https://gist.githubusercontent.com/tomjhuangCompal/d2795648a8aced4bebcb5674c0b7aba1/raw/jest-coverage-comment__main.json)
Front structure
Resource
webpack v4building tool forreact-router,redux- linting tool
eslint react-storybookfor module development- Syntax
ES6、stage-3.
How to begin
- install node.js v6 or further
- install node module:
npm ioryarn install
Start server
start demo server
yarn startYou canc see the project demo server running on http://localhost:3000
start storybook server
yarn storybookYou can see the storybook server running on http://localhost:6006
You also can see the storybook on github page https://redesigned-engine-831ba07b.pages.github.io/
npm script
- npm start: start server at port 3000
- npm run build:dev: build react project by
webpack.dev.config - npm run build: build react project by
webpack.prod.config - npm run lint: run eslint to check coding style
- npm run storybook: run storybook
Project Structure
Following is the file structure of this project
- .storybook: storybook config
- src
- images: pictures for react frontend
- react
- actions: define action function
- components: react components
- constants: redux action type constants.
- reducers: redux states
- request: request api function and endpoint
- routes: define the routing rule
- styles: universal usage styles, css files.
- .storybook: storybook storise
- storise: storybook storise
參數設定
Environment
以下是 yarn build:dev, yarn build:sit, yarn build:uat, yarn build 各自對應的環境變數
| script | NODE_ENV | process.env.NODE_ENV | process.env.PROXY | process.env.API |
|---|---|---|---|---|
| build:dev | dev | dev | dev | dev |
| build:sit | production | production | sit | sit |
| build:uat | production | production | uat | uat |
| build | production | production | NULL | production |
CSS
CSS variables is setting at src/styles/variables, you have to import it in your target file to use it.
export default {
standard: '#999',
secondary: '#DDD',
darkBlack: '#404040',
};1.43.3
3 years ago