VSCode笔记
配置`.vscode/tasks.json`以在打开文件夹时自动运行指定的npm脚本,并在MacOS上设置终端配置以使用zsh。
配置`.vscode/tasks.json`以在打开文件夹时自动运行指定的npm脚本,并在MacOS上设置终端配置以使用zsh。
打开文件夹时自动运行脚本,配置.vscode/tasks.json
:
{
"version": "2.0.0",
"tasks": [
{
"label": "npm start with nvm",
"type": "shell",
"command": "source ~/.zshrc && nvm use 14 && npm start",
"presentation": {
"echo": true,
"reveal": "always",
"focus": false,
"panel": "shared"
},
"runOptions": {
"runOn": "folderOpen"
}
}
]
}
在MacOS上需要添加以下配置:
"terminal.integrated.profiles.osx": { "zsh": { "path": "/bin/zsh", "args": ["-l", "-i"] } }