Skip to content

3.0 | Building

Rácz Zalán edited this page Nov 25, 2023 · 2 revisions

Before you can build the extension, you have to install all the dependencies (they will be placed into the node_modules folder), and generate code. After that, you can build the code by using the build, or the watch scripts, and you can build it in production mode with build-production. After you build the code, you can also package the extension. If you want to know more about building and running the extension, there are step-by-step instructions for Windows, and for Linux.

TypeScript

The extension's source code is written in TypeScript, which is a typed superset of JavaScript. When you build the code, each TypeScript file is transpiled to a JavaScript file by the TypeScript Compiler. You can find the configuration in the tsconfig.json file.

Webpack

After the TypeScript Compiler finishes the transpilation, Webpack bundles together all the JavaScript files into a single file (technically, the whole TypeScript transpilation is part of the bundling). You can find the configuration in the webpack.config.js file.

Desktop and web version

The extension actually has 2 versions: a desktop, and a web version. The desktop version can run in VS Code, using Windows, Mac, and Linux, while the web version can run in the browser, for example, in github.dev, or vscode.dev. The web version has some limitations, for example, it can't use Node.js, and can't run executables.

Build artifacts

After building the extension, the dist folder will contain the build artifacts: extension-desktop.js, extension-web.js, and the corresponding mappings.

Useful resources