Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to correctly bundle a vscode extension using webpack

The problem that i am having is that when i run vsce package i still get the This extension consists of 3587 separate files. For performance reasons, you should bundle your extension: warning, i followed the Bundling Extension steps, debugging works as expected.

package.json

{
  "main": "./out/extension",
  "scripts": {
    "vscode:prepublish": "webpack --mode production",
    "webpack": "webpack --mode development",
    "webpack-dev": "webpack --mode development --watch",
    "compile": "npm run webpack",
    "watch": "tsc -watch -p ./",
    "postinstall": "node ./node_modules/vscode/bin/install"
  },
}

The webpack config is an exact copy of the Bundling Extension example.

like image 203
Syler Avatar asked Oct 21 '25 16:10

Syler


1 Answers

This sounds like you might've forgotten to add the source directories to .vscodeignore, so they're still being packaged into the release. The ignore file should probably contain at least the following, plus anything else not needed at runtime:

src/**
node_modules/**
like image 84
Gama11 Avatar answered Oct 24 '25 05:10

Gama11



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!