feat: 更新 Dockerfile 和 devcontainer.json,优化开发环境配置和扩展推荐
All checks were successful
CI/CD Pipeline / playwright (push) Successful in 2m17s
CI/CD Pipeline / build-and-deploy (push) Successful in 2m26s

This commit is contained in:
严浩
2025-11-07 08:18:45 +00:00
parent ce2f5338de
commit 8d052bcac8
2 changed files with 115 additions and 114 deletions

View File

@@ -25,19 +25,25 @@
"customizations": {
"vscode": {
"extensions": [
// AI
"anthropic.claude-code",
"google.gemini-cli-vscode-ide-companion",
"dbaeumer.vscode-eslint",
"esbenp.prettier-vscode",
"eamodio.gitlens",
"oxc.oxc-vscode",
"editorconfig.editorconfig",
"vitest.explorer",
"vue.volar",
"kilocode.kilo-code",
"alibaba-cloud.tongyi-lingma",
// >>>>>
"vue.volar",
"lokalise.i18n-ally",
"eamodio.gitlens",
"vitest.explorer",
// <<<<<
// 代码质量 / 格式化 / Lint
"editorconfig.editorconfig",
"dbaeumer.vscode-eslint",
"stylelint.vscode-stylelint",
"lokalise.i18n-ally"
"oxc.oxc-vscode",
"esbenp.prettier-vscode"
],
"settings": {
"editor.formatOnSave": true,
@@ -47,24 +53,25 @@
},
"terminal.integrated.defaultProfile.linux": "zsh",
"terminal.integrated.profiles.linux": {
"bash": {
"path": "bash",
"icon": "terminal-bash"
},
"zsh": {
"path": "zsh",
"icon": "terminal-debian"
}
}
"bash": { "path": "bash", "icon": "terminal-bash" },
"zsh": { "path": "zsh", "icon": "terminal-debian" }
},
// https://stackoverflow.com/questions/75708866/vscode-dev-container-fails-to-load-ms-vscode-js-debug-extension-correctly
// https://davidwesst.com/blog/missing-bootloader-in-vscode-devcontainer/
/**
* autoAttachFilter NODE_OPTIONS bootloader.js --require
* --max-old-space-size
* NODE_OPTIONS= --require /home/.../bootloader.js --max-old-space-size=4096--max-old-space-size=4096
*
* Error: illegal value for flag --max-old-space-size=4096--max-old-space-size=4096 of type size_t
* "disabled"
*/
"debug.javascript.autoAttachFilter": "disabled"
}
}
},
"remoteUser": "usr_vscode",
"mounts": [
// "source=dev-container-config-${devcontainerId},target=/root/.claude,type=volume",
// "source=node_modules-u_node-${devcontainerId},target=/workspace/node_modules,type=volume",
// "source=dev-container-bashhistory-${devcontainerId},target=/commandhistory,type=volume"
],
"containerEnv": {
// "CLAUDE_CONFIG_DIR": "/home/usr_vscode/.claude",
"ANTHROPIC_AUTH_TOKEN": "${localEnv:ANTHROPIC_AUTH_TOKEN}",
@@ -73,9 +80,14 @@
"GOOGLE_GEMINI_BASE_URL": "${localEnv:GOOGLE_GEMINI_BASE_URL}",
"NODE_OPTIONS": "--max-old-space-size=4096"
},
// "postCreateCommand": "pnpm install", // 容器创建后执行
"remoteUser": "usr_vscode",
"mounts": [
// "source=dev-container-bashhistory-${devcontainerId},target=/commandhistory,type=volume"
"source=${localWorkspaceFolderBasename}-node_modules,target=${containerWorkspaceFolder}/node_modules,type=volume"
],
"postCreateCommand": "sudo chown usr_vscode node_modules", // 容器创建后执行 https://code.visualstudio.com/remote/advancedcontainers/improve-performance
"postStartCommand": "pnpm -v", // 每次容器启动时执行
"postAttachCommand": "pnpm config get store-dir", // 连接到容器后执行
// "postAttachCommand": "pnpm config get store-dir", // 连接到容器后执行
// "updateRemoteUserUID": true,
// "waitFor": "postStartCommand"
"workspaceMount": "source=${localWorkspaceFolder},target=/workspace,type=bind,consistency=delegated",