首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何设置vscode插件的环境变量?

如何设置vscode插件的环境变量?
EN

Stack Overflow用户
提问于 2020-06-21 02:25:13
回答 1查看 2.7K关注 0票数 4

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

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2020-06-21 02:37:23

您可以通过启动配置将环境变量传递给在本地运行的VS代码扩展:

./.vscode/launch.json

代码语言:javascript
复制
// 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
            }
        }
    ]
}
票数 4
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/62493776

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档