首页 > 解决方案 > 安装扩展时VSCode扩展依赖安装

问题描述

我已经为 Visual Studio 代码创建了一个扩展。在我的 package.json 中,我有一个很大的依赖项列表:

"dependencies": {
        "@types/fs-extra": "^8.0.0",
        "@types/puppeteer-core": "^2.0.0",
        "@types/yamljs": "^0.2.30",
        "anchor-markdown-header": "^0.5.7",
        "clone": "^2.1.2",
        "dedent": "^0.7.0",
        "front-matter": "^3.0.2",
        "fs-extra": "^8.1.0",
        "get-port": "^5.1.1",
        "highlight.js": "^9.18.0",
        "localized-resource-manager": "^1.2.0",
        "markdown-it": "^10.0.0",
        "markdown-it-anchor": "^5.2.5",
        "markdown-it-checkbox": "^1.1.0",
        "markdown-it-emoji": "^1.4.0",
        "markdown-it-table-of-contents": "^0.4.4",
        "multi-integer-range": "^4.0.8",
        "mustache": "^4.0.0",
        "puppeteer-core": "^2.1.1",
        "rxjs": "^6.5.4",
        "serve-handler": "^6.1.2",
        "simple-git": "^1.131.0",
        "string-template": "^1.0.0",
        "svn-spawn": "^0.1.6",
        "temp-filesystem": "^1.1.3",
        "transliteration": "^2.1.8",
        "twemoji": "^12.1.5",
        "utf8": "^3.0.0",
        "website-scraper": "^4.2.0",
        "yamljs": "^0.3.0"
    },

我的问题是我需要将所有这些依赖项(及其依赖项)嵌入我的包 node_modules 文件夹中。

所以我的包现在包含超过 5000 个文件和超过 300 MB。

有没有办法不在包中包含 node_modules 文件夹,但在安装我的扩展程序时告诉 vscode 安装它们?

谢谢 :)

标签: visual-studio-codedependenciesvscode-extensions

解决方案


推荐阅读