launch.json 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. {
  2. "version": "0.2.0", // 配置文件版本号(由VSCode定义,勿修改)
  3. "configurations": [
  4. {
  5. // 开发环境调试配置
  6. "name": "调试 UniApp Weixin", // 配置项显示名称
  7. "type": "node", // 调试器类型(Node.js环境)
  8. "request": "launch", // 启动模式(launch/attach)
  9. // "runtimeExecutable": "npm", // 使用npm作为运行时
  10. "runtimeExecutable": "C:\\Program Files\\nodejs\\npm.cmd",
  11. "runtimeArgs": ["run", "dev:mp-weixin"], // 运行的npm脚本命令
  12. "console": "integratedTerminal", // 在VSCode内置终端显示输出
  13. "skipFiles": ["<node_internals>/**"], // 调试时跳过的文件
  14. "presentation": { // 终端显示配置
  15. "reveal": "always", // 总是显示终端面板
  16. "panel": "dedicated" // 使用独立终端(避免与其他输出混合)
  17. }
  18. },
  19. {
  20. "name": "调试 UniApp H5",
  21. "type": "node",
  22. "request": "launch",
  23. "runtimeExecutable": "C:\\Program Files\\nodejs\\npm.cmd",
  24. "runtimeArgs": ["run", "dev:h5"],
  25. "console": "integratedTerminal",
  26. "skipFiles": ["<node_internals>/**"],
  27. "presentation": {
  28. "reveal": "always",
  29. "panel": "dedicated"
  30. }
  31. },
  32. {
  33. // 生产环境构建配置
  34. "name": "Build UniApp Weixin", // 配置项显示名称
  35. "type": "node", // 调试器类型
  36. "request": "launch", // 启动模式
  37. "runtimeExecutable": "npm", // 使用npm作为运行时
  38. "runtimeArgs": ["run", "build:mp-weixin"], // 运行的npm脚本命令
  39. "console": "integratedTerminal" // 在VSCode内置终端显示输出
  40. // 注:生产构建通常不需要调试,故省略presentation配置
  41. }
  42. ]
  43. }