How to use the vsce.PackageManager function in vsce

To help you get started, we’ve selected a few vsce examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github microsoft / vscode / build / lib / extensions.js View on Github external
function fromLocalWebpack(extensionPath, sourceMappingURLBase) {
    const result = es.through();
    const packagedDependencies = [];
    const packageJsonConfig = require(path.join(extensionPath, 'package.json'));
    if (packageJsonConfig.dependencies) {
        const webpackRootConfig = require(path.join(extensionPath, 'extension.webpack.config.js'));
        for (const key in webpackRootConfig.externals) {
            if (key in packageJsonConfig.dependencies) {
    vsce.listFiles({ cwd: extensionPath, packageManager: vsce.PackageManager.Yarn, packagedDependencies }).then(fileNames => {
        const files = fileNames
            .map(fileName => path.join(extensionPath, fileName))
            .map(filePath => new File({
            path: filePath,
            stat: fs.statSync(filePath),
            base: extensionPath,
            contents: fs.createReadStream(filePath)
        const filesStream = es.readArray(files);
        // check for a webpack configuration files, then invoke webpack
        // and merge its output with the files stream. also rewrite the package.json
        // file to a new entry point
        const webpackConfigLocations = glob.sync(path.join(extensionPath, '/**/extension.webpack.config.js'), { ignore: ['**/node_modules'] });
        const packageJsonFilter = filter(f => {
            if (path.basename(f.path) === 'package.json') {
                // only modify package.json's next to the webpack file.


VSCode Extension Manager

Latest version published 1 year ago

Package Health Score

53 / 100
Full package analysis