From 759f4e858aefd43be99df07f12f1ebeeadc988d2 Mon Sep 17 00:00:00 2001 From: lovely90133 Date: Thu, 9 Apr 2026 13:52:04 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=E5=BC=80=E5=8F=91?= =?UTF-8?q?=E5=91=BD=E4=BB=A4=E5=B9=B6=E4=BC=98=E5=8C=96=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 添加 `dev` 命令以并行启动 api 和 client 服务 为 api 服务的 serve 目标添加 copy-assets 依赖 为 client 服务的 serve 配置添加 hmr 和 open 选项 设置 client 服务的默认配置为 development-en --- apps/api/project.json | 3 ++- apps/client/project.json | 5 ++++- package.json | 1 + 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/apps/api/project.json b/apps/api/project.json index 4e1affb13..d9af89108 100644 --- a/apps/api/project.json +++ b/apps/api/project.json @@ -58,7 +58,8 @@ "executor": "@nx/js:node", "options": { "buildTarget": "api:build" - } + }, + "dependsOn": ["copy-assets"] }, "lint": { "executor": "@nx/eslint:lint", diff --git a/apps/client/project.json b/apps/client/project.json index 38887ca8a..010b5c8a4 100644 --- a/apps/client/project.json +++ b/apps/client/project.json @@ -218,7 +218,9 @@ "proxyConfig": "apps/client/proxy.conf.json", "ssl": true, "sslCert": "apps/client/localhost.cert", - "sslKey": "apps/client/localhost.pem" + "sslKey": "apps/client/localhost.pem", + "hmr": true, + "open": true }, "configurations": { "development-ca": { @@ -264,6 +266,7 @@ "buildTarget": "client:build:production" } }, + "defaultConfiguration": "development-en", "continuous": true }, "extract-i18n": { diff --git a/package.json b/package.json index 686065630..eaf5c79d8 100644 --- a/package.json +++ b/package.json @@ -42,6 +42,7 @@ "start:client": "nx run client:copy-assets && nx run client:serve --configuration=development-en --hmr -o", "start:production": "npm run database:migrate && npm run database:seed && node main", "start:server": "nx run api:copy-assets && nx run api:serve --watch", + "dev": "nx run-many --target=serve --projects=api,client --parallel=2", "start:storybook": "nx run ui:storybook", "test": "npx dotenv-cli -e .env.example -- npx nx run-many --target=test --all --parallel=4", "test:api": "npx dotenv-cli -e .env.example -- nx test api",