统一 frontend、backend、test、test-log 和 out 目录,更新构建、部署及测试入口;纳入配置管理兼容与首次安全引导修复;排除本机配置、密钥和测试产物。
This commit is contained in:
1 parent
28cd9d3406
commit
f60d3b0880
603 files changed
+2351
-660
No files matched your search
@@ -0,0 +1,43 @@
|
||||
# 前端
|
||||
|
||||
前端代码库
|
||||
|
||||
```sh
|
||||
yarn
|
||||
```
|
||||
|
||||
### 开发与热更新
|
||||
|
||||
```sh
|
||||
yarn dev
|
||||
```
|
||||
|
||||
开发代理默认连接本机 HTTPS 后端 `https://127.0.0.1:443`。如果后端使用其他地址,请在 `frontend/.env.development` 中设置:
|
||||
|
||||
```env
|
||||
VITE_DEV_BACKEND_URL=https://127.0.0.1:443
|
||||
```
|
||||
|
||||
自签名证书仅用于本地开发,代理不会校验证书链;生产环境应使用有效证书。
|
||||
|
||||
### 生产构建
|
||||
|
||||
```sh
|
||||
yarn build
|
||||
```
|
||||
|
||||
产物写入根目录的 `out/frontend/`,随后由 `deploy/prepare-frontend.mjs` 同步到后端必需的 Go 嵌入目录。不要再手动复制到 `frontend/dist/`。
|
||||
|
||||
### 自动测试
|
||||
|
||||
```sh
|
||||
yarn test
|
||||
```
|
||||
|
||||
测试源码位于 `test/frontend/`,通过 `test/run.mjs` 统一执行,日志写入 `test-log/`,无需在测试目录重复安装 Vue 依赖。
|
||||
|
||||
### 代码检查 [ESLint](https://eslint.org/)
|
||||
|
||||
```sh
|
||||
yarn lint
|
||||
```
|
||||
Reference in new issue
Block a user