VS Code配置F5一键运行Vue应用(npm run serve)

VsCode能否一键运行程序?比如按下F5,直接运行npm run serve

答案是可以!!!

请往下看。

初始化(启用)

VS Code配置F5一键运行Vue应用(npm run serve)

VS Code配置F5一键运行Vue应用(npm run serve)

{
  "version": "0.2.0",
  "configurations": [
    {
      "type": "node",
      "request": "launch",
      "name": "Launch Program",
      "skipFiles": ["<node_internals>/**"],
      "program": "${workspaceFolder}\\app.js"
    }
  ]
}

会自动生成.vscode/launch.json文件。

编辑启动配置文件

launch.json

{
    // Use IntelliSense to learn about possible attributes.
    // Hover to view descriptions of existing attributes.
    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [{
        "type": "node",
        "request": "launch",
        "name": "serve",
        "skipFiles": [
            "<node_internals>/**"
        ],
        "program": "${workspaceRoot}/node_modules/@vue/cli-service/bin/vue-cli-service.js",
        "args": ["serve"]
    }]
}

快捷键

F5:启动调试

Ctrl + F5:直接运行

Shift + F5:终止调试

Ctrl + Shift + F5:重启调试

上一篇:解决Vuex持久化插件-在F5刷新页面后数据不见的问题


下一篇:[IDA] F5时参数识别错误的修正策略