思涯谷

  • 首页
  • 探索
  • 标签
  • 关于
思涯谷 ©2025
京ICP备2022030312号GitHub User's stars

VSCode笔记

配置`.vscode/tasks.json`以在打开文件夹时自动运行指定的npm脚本,并在MacOS上设置终端配置以使用zsh。

...
标签:笔记NodeReactJavaScript
点赞(0)
返回顶部

相关内容

  • Taro和JS笔记系列
  • 单页应用(SPA)和多页应用(MPA)
  • nvm、npm、nrm、pnpm的安装
  • 面试笔记
  • 根据背景获取文字颜色
2024-11-25

留言

打开文件夹时自动运行脚本,配置.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"
]
}
}