txw/README.md

51 lines
1.2 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 碳信网 Web 项目本地开发指南
## 环境要求
- Node.js >= 14建议 16+
- Yarn >= 1.22
## 1. 安装依赖
```bash
node setup.js
```
脚本会自动为所有 web 项目创建本地包链接并安装依赖。Windows 和 Mac 通用。
> 如果网络不稳定,加 `--prefer-offline` 会优先从本地缓存获取包,速度更快。
## 2. 启动开发服务
```bash
# 以碳门户主页为例
cd txw-mhzc-web
yarn dev
```
其他项目同理:`txw-gxzx-web`、`txw-kxtfwzx-web`、`txw-tzzx-web`、`txw-ytzx-web`、`txw-yygl-web`
## 3. 项目说明
| 目录 | 说明 |
|------|------|
| `txw-gxzx-web` | 个人工作台 |
| `txw-kxtfwzx-web` | 科学碳体重中心 |
| `txw-mhzc-web` | 碳门户主页 |
| `txw-yygl-web` | 运营管理 |
| `local-nodemodules` | 本地私有包ggzc-web 组件库) |
## 4. 常见问题
**Q: yarn install 报 `@cssyq/ggzc-web` not found**
A: 需要先建立 symlink。执行第 1 步中的 for 循环即可。
**Q: 启动报错 engine node incompatibility**
A: 加 `--ignore-engines` 参数绕过。
**Q: 需要更新 ggzc-web 组件库?**
A: 修改 `local-nodemodules/@cssyq/ggzc-web` 后,直接 `yarn dev` 即可看到更新(已通过 symlink 关联)。