将启动项目放在postAttachCommand阶段执行

This commit is contained in:
2025-10-21 16:45:21 +08:00
parent 160906b6fd
commit dd9cc60ceb
2 changed files with 2 additions and 3 deletions

View File

@@ -5,8 +5,7 @@
5173 5173
], ],
"postCreateCommand": "npm install && npm add -D vitepress", "postCreateCommand": "npm install && npm add -D vitepress",
"postStartCommand": "npm run docs:dev -- --host 0.0.0.0", "postAttachCommand": "npm run docs:dev -- --host 0.0.0.0",
// "postAttachCommand": "pkill -f 'vite' || npm run docs:dev -- --host 0.0.0.0",
"customizations": { "customizations": {
"vscode": { "vscode": {
"extensions": [ "extensions": [

View File

@@ -7,7 +7,7 @@ Vitepress 模板
## 使用方法 ## 使用方法
``` ```
进入容器后会自动执行 npm run docs:dev -- --host 0.0.0.0命令,访问http://localhost:5173/即可 进入容器后会自动执行 npm run docs:dev -- --host 0.0.0.0命令,访问终端显示的端口即可
项目启动命令为npm run docs:dev -- --host 0.0.0.0 项目启动命令为npm run docs:dev -- --host 0.0.0.0
``` ```