Browse Source

feat: 添加开发命令并优化项目配置

添加 `dev` 命令以并行启动 api 和 client 服务
为 api 服务的 serve 目标添加 copy-assets 依赖
为 client 服务的 serve 配置添加 hmr 和 open 选项
设置 client 服务的默认配置为 development-en
pull/6706/head
lovely90133 2 months ago
parent
commit
759f4e858a
  1. 3
      apps/api/project.json
  2. 5
      apps/client/project.json
  3. 1
      package.json

3
apps/api/project.json

@ -58,7 +58,8 @@
"executor": "@nx/js:node",
"options": {
"buildTarget": "api:build"
}
},
"dependsOn": ["copy-assets"]
},
"lint": {
"executor": "@nx/eslint:lint",

5
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": {

1
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",

Loading…
Cancel
Save