1.0.2 • Published 6 years ago
gyr-cli v1.0.2
简介
一个react+redux+stylus+webpack+antd+mui的框架
安装
- yarn install(没有yarn请前去安装yarn)
- 如果安装失败 yarn install --no-lockfile
启动
pm2 start build/ecosystem.config.js || npm start
重启 pm2 restart agent // ([app-name|id])
关闭 pm2 stop agent
删除 pm2 delete agetnt
日志 pm2 logs agent
打包
npm run build 打包之后会再当目录生成一个dist文件夹 index.html就是入口文件
src项目结构描述
- actions 存储redux的Action
- components 存储组件
- containers 容器,调用组件组织页面
- imgs 存储图片
- pages 存储对应路由的页面
- plugins 插件
- reducers 存储redux的reducer
- router 路由配置
- stylus stylus存储目录
- app.js 入口js
- index.html 入口html页面
babel
- babel-preset-env(推荐) 替代了 babel-preset-es2015
其他
- react 中文官网 http://www.react-cn.com/
- 使用antd为了减少项目大小,使用 babel-plugin-import babel-plugin-import
- stylus参考网址 http://stylus-lang.com/
- antdesign参考网址 https://ant.design/index-cn
- redux中文文档 http://www.redux.org.cn/
- react-router参考网址 https://reacttraining.com/react-router/web/guides/quick-start
- react-router v4中文地址 https://reacttraining.cn
- redux-actions https://github.com/acdlite/redux-actions
- webpack中文文档地址 https://doc.webpack-china.org
- ant design mobile https://mobile.ant.design/index-cn
- antd mobile 0.8 以上版本「高清」方案设置
- mui 文档 http://dev.dcloud.net.cn/mui/
- h5+ native.js文档 http://ask.dcloud.net.cn/docs/
- tslint文档 https://palantir.github.io/tslint/
- jest单元测试 http://facebook.github.io/jest/
issue
- typescript Cannot find name 'PropertyKey'
在es2015中才有propertyKey数据类型 在tsconfig.json配置文件compilerOptions添加lib
"lib": [
"es2015",
"dom"
]