We're using esbuild --keep-names --minify. The --keep-names option prevents minification from mangling the names which breaks node-fetch package. See this issue related to node-fetch v2.
The output of the compilation (if any) is in out/ and the bunled output is now in dist/. While esbuild transpiles typescript to javascript without the need to call tsc anymore, we still call tsc --noEmit for type checking.
How bundling affects development:
Release build
yarn run publish creates a minified build for production. No sourcemaps are created.
Note that the "publish" target invokes "vscode:prepublish" which removes the output folders, performs type/format/link checks, builds the query editor and bundles the extension code.
Debugging extension copied under ADS source code extensions folder and using ADS "Launch Renderer & Debug Renderer And Extension Host" debug target inside VSC
In ADS, update the debug configuration file launch.json:
Look for the "Attach to Extension Host" target and add the dist/ directory in the "outFiles" section:
"outFiles": [
"${workspaceFolder}/out/**/*.js",
"${workspaceFolder}/extensions/*/out/**/*.js",
"${workspaceFolder}/extensions/*/dist/**/*.js" <------------- Add this line
],
On the extension side, use yarn run esbuild:watch to make esbuild automatically re-bundle for every source change
As usual restart ADS if you want the new change to take effect
Debugging extension with standard ADS installed
yarn run esbuild:watch to automatically re-bundle for every source change
As usual restart ADS if you want the new change to take effect
This bundles the extension using esbuild.
We're using
esbuild --keep-names --minify
. The--keep-names
option prevents minification from mangling the names which breaksnode-fetch
package. See this issue related to node-fetch v2.The output of the compilation (if any) is in
out/
and the bunled output is now indist/
. While esbuild transpiles typescript to javascript without the need to calltsc
anymore, we still calltsc --noEmit
for type checking.How bundling affects development:
Release build
yarn run publish
creates a minified build for production. No sourcemaps are created. Note that the "publish" target invokes "vscode:prepublish" which removes the output folders, performs type/format/link checks, builds the query editor and bundles the extension code.Debugging extension copied under ADS source code
extensions
folder and using ADS "Launch Renderer & Debug Renderer And Extension Host" debug target inside VSClaunch.json
: Look for the "Attach to Extension Host" target and add thedist/
directory in the"outFiles"
section:yarn run esbuild:watch
to make esbuild automatically re-bundle for every source changeDebugging extension with standard ADS installed
yarn run esbuild:watch
to automatically re-bundle for every source change