Skip to main content

Prerequisites

Before building VS Code from source, ensure you have the following installed:

Node.js

Required for running build scripts and dependencies

Git

For cloning the repository and version control

Python

Required for building native modules

C++ Compiler

Platform-specific compiler for native dependencies
Development Container Available: VS Code includes a Dev Container configuration that provides a pre-configured environment with all prerequisites. Docker needs at least 4 Cores and 8 GB of RAM (9 GB recommended).

System Requirements

  • Xcode Command Line Tools: Install with xcode-select --install
  • Node.js: Version specified in .nvmrc
  • Python: Version 3.x
  • Minimum RAM: 8 GB (16 GB recommended)

Getting the Source Code

1

Clone the Repository

Clone the VS Code repository from GitHub:
2

Install Dependencies

Install all npm dependencies. The postinstall script will automatically run after installation:
The postinstall script (build/npm/postinstall.ts) handles additional setup tasks automatically.
3

Download Electron

Download the Electron binary (unless skipped via environment variable):
This command runs node build/lib/electron.ts to download the correct Electron version.

Building VS Code

Full Compilation

Compile all TypeScript sources using Gulp:
This internally runs:
The build process allocates up to 8 GB of heap space for Node.js. Ensure you have sufficient RAM available.

Building Specific Components

Running from Source

Launch VS Code from source:
The script will:
  1. Run the preLaunch task (if VSCODE_SKIP_PRELAUNCH is not set)
  2. Set development environment variables
  3. Launch Electron with VS Code
Environment variables set:
  • NODE_ENV=development
  • VSCODE_DEV=1
  • VSCODE_CLI=1
  • ELECTRON_ENABLE_STACK_DUMPING=1
  • ELECTRON_ENABLE_LOGGING=1

Running Web Version

Launch VS Code in a browser:
The web version runs on http://localhost:8080 by default.

Build Optimization

Watch Mode for Development

For active development, use watch mode to automatically recompile on file changes:
This runs three parallel watch tasks:
  • watch-client-transpile: Transpiles client TypeScript
  • watch-client: Watches client code
  • watch-extensions: Watches extension code

Individual Watch Tasks

Using Deemon for Process Management

Deemon provides daemon-style process management for watch tasks:

Production Builds

For production-ready builds:
1

Minify VS Code

2

Minify Remote Extension Host

3

Minify Remote Extension Host Web

Using Development Containers

Local Development Container

1

Install Prerequisites

  • Docker Desktop (macOS/Windows) or Docker (Linux)
  • VS Code with Dev Containers extension
2

Clone in Container

Press Ctrl/Cmd + Shift + P and select:
Enter: https://github.com/microsoft/vscode
3

Build and Run

After the container starts:

GitHub Codespaces

1

Create Codespace

From the GitHub repository, click Code → Open with Codespaces → New codespace
2

Select Machine Size

Choose Standard machine (4-core, 8GB RAM)
3

Access Desktop

The codespace provides a VNC-based desktop environment:
The development container uses Fluxbox window manager. Right-click on the desktop to see menu options.

Troubleshooting

Build Failures

Increase Node.js heap size:
Ensure you have the correct C++ compiler:
  • macOS: Install Xcode Command Line Tools
  • Linux: Install build-essential
  • Windows: Install Visual Studio with C++ workload
Set the Electron mirror if you’re behind a firewall:
Use WSL on Windows or the Dev Container approach for better I/O performance:

Clean Build

If you encounter persistent issues, perform a clean build:

Next Steps

Development Workflow

Learn about the development workflow and tools

Debugging

Set up debugging for VS Code development

Running Tests

Learn how to run and write tests

Contributing

Read the contribution guidelines