我试着用交叉env设置它,但是在使用VSCode运行之后,它没有定义。我怎么才能修好它?

发布于 2020-06-21 02:37:23
您可以通过启动配置将环境变量传递给在本地运行的VS代码扩展:
./.vscode/launch.json
// A launch configuration that compiles the extension and then opens it inside a new window
// 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": [
{
"name": "Run Extension",
"type": "extensionHost",
"request": "launch",
"runtimeExecutable": "${execPath}",
"args": [
"--extensionDevelopmentPath=${workspaceFolder}"
],
"outFiles": [
"${workspaceFolder}/dist/extension.js"
],
"preLaunchTask": "${defaultBuildTask}",
"env": {
"DEBUG": "true" // <---- EXAMPLE ENVIRONMENT VARIABLE
}
}
]
}https://stackoverflow.com/questions/62493776
复制相似问题