Optimize packaged extension
esbuild is an extremely fast JavaScript/TypeScript bundler. On my (admittedly powerful) PC, esbuild can bundle (and minify) this extension in ~40ms.
The main advantage is a reduction in the number and size of files loaded by VSCode. Currently, the packaged extension contains ~3500 files:
-
node_modules/
- ~2900 files -
out/
- ~400 files -
src/
- ~200 files - these should be added to .vscodeignore, since source files are not needed at runtime - Miscellaneous other - 25 files
Using esbuild can reduce the total file count to ~30 by bundling each entry point into a single file, thus eliminating node_modules
and out
. AFAIK, there are two entry points: main and webview.
Removing src
reduces the extension size by 2.2MB. Bundling the main entry point and eliminating node_modules
and out
reduces the extension size by 9MB. This is size of the files, after unpacking the extension from the .vsix/ZIP. This does not include the webview, because I'm not sure how to use esbuild with Vue.
I am interested in submitting an MR.