chore(devcontainer): refine configuration and simplify tasks
All checks were successful
CI/CD Pipeline / playwright (push) Successful in 1m58s
CI/CD Pipeline / build-and-deploy (push) Successful in 2m12s

This commit is contained in:
严浩
2025-11-12 23:56:59 +08:00
parent 10fcb40d1d
commit d0a7afd5df
3 changed files with 25 additions and 54 deletions

View File

@@ -1,3 +1,4 @@
# docker build -t my-dev-container .
FROM debian:13.1-slim
# 元数据

View File

@@ -6,23 +6,8 @@
*/
{
"name": "SBX",
"forwardPorts": [4730, 4731], // vscode://settings/remote.localPortHost -> 默认只监听 localhost
"portsAttributes": {
"4730": {
"label": "开发服务器端口",
"onAutoForward": "notify"
},
"4731": {
"label": "预览服务器端口",
"onAutoForward": "notify"
}
},
"build": {
"dockerfile": "Dockerfile",
"args": {
//
}
},
"image": "my-dev-container",
// "build": { "dockerfile": "Dockerfile", "args": {} },
"runArgs": [
// -----
// "--network=host",
@@ -36,22 +21,29 @@
"--add-host=host.docker.internal:host-gateway",
"--name=${localWorkspaceFolderBasename}-devcontainer"
],
"forwardPorts": [4730, 4731], // vscode://settings/remote.localPortHost -> 默认只监听 localhost
"portsAttributes": {
"4730": { "label": "开发服务器端口", "onAutoForward": "openPreview" },
"4731": { "label": "预览服务器端口", "onAutoForward": "notify" }
},
"customizations": {
"vscode": {
"extensions": [
// AI
"github.copilot",
"github.copilot-chat",
"vicanent.gcmp",
"anthropic.claude-code",
"google.gemini-cli-vscode-ide-companion",
"kilocode.kilo-code",
"alibaba-cloud.tongyi-lingma",
// >>>>>
"vue.volar",
"lokalise.i18n-ally",
"gruntfuggly.todo-tree",
"eamodio.gitlens",
"lokalise.i18n-ally",
"vitest.explorer",
"antfu.unocss",
"vicanent.gcmp",
"gruntfuggly.todo-tree",
"vue.volar",
// <<<<<
// 代码质量 / 格式化 / Lint
"editorconfig.editorconfig",
@@ -67,17 +59,10 @@
{
"type": "npm",
"script": "dev",
"label": "🚀 dev-in-container",
"label": "🚀 Dev: Run on Folder Open",
"detail": "启动开发服务器",
"runOptions": { "runOn": "folderOpen" },
"problemMatcher": {
"pattern": { "regexp": "." },
"background": {
"activeOnStart": true,
"beginsPattern": "VITE.*ready in",
"endsPattern": "(Local|Network):.*http"
}
},
"problemMatcher": [],
"isBackground": true,
"presentation": { "reveal": "always", "panel": "dedicated" },
"group": { "kind": "build", "isDefault": false }
@@ -89,16 +74,13 @@
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "explicit"
},
"terminal.integrated.defaultProfile.linux": "zsh",
"terminal.integrated.defaultProfile.linux": "💲zsh",
"terminal.integrated.profiles.linux": {
"🐚bash": {
"path": "bash",
"icon": "terminal-bash"
},
"💲zsh": {
"path": "zsh",
"icon": "terminal-cmd",
"overrideName": true
"overrideName": true,
"color": "terminal.ansiGreen"
}
},
// https://stackoverflow.com/questions/75708866/vscode-dev-container-fails-to-load-ms-vscode-js-debug-extension-correctly

24
.vscode/tasks.json vendored
View File

@@ -6,16 +6,12 @@
"script": "dev",
"label": "🚀 dev",
"detail": "启动开发服务器",
"problemMatcher": {
"pattern": { "regexp": "." },
"background": {
"activeOnStart": true,
"beginsPattern": "VITE.*ready in",
"endsPattern": "(Local|Network):.*http"
}
},
"problemMatcher": [],
"isBackground": true,
"presentation": { "reveal": "always", "panel": "dedicated" },
"presentation": {
"reveal": "always", // 控制运行任务的终端是否显示。可按选项 "revealProblems" 进行替代。默认设置为“始终”。
"panel": "dedicated" // dedicated一个任务独占一个终端方便查看特定任务的日志不会被其他任务干扰。
},
"group": { "kind": "build", "isDefault": false }
},
{
@@ -23,7 +19,6 @@
"script": "build-only",
"label": "🔨 build-only",
"detail": "" /* VSCode 使 package.json scripts[scriptName] detail */,
"problemMatcher": ["$tsc"],
"presentation": { "reveal": "always", "panel": "shared" },
"group": { "kind": "none", "isDefault": false }
},
@@ -33,14 +28,7 @@
"label": "☁️ wrangler:dev",
"detail": "启动 Cloudflare Workers 开发服务器,相当于预览",
"dependsOn": ["🔨 build-only"],
"problemMatcher": {
"pattern": { "regexp": "." },
"background": {
"activeOnStart": true,
"beginsPattern": "wrangler dev",
"endsPattern": "Ready on"
}
},
"problemMatcher": [],
"isBackground": true,
"presentation": { "reveal": "always", "panel": "dedicated" },
"group": { "kind": "build", "isDefault": false }