easily embed VSCode web-standalone in projects
# npm
$ npm install -D codem
# pnpm
$ pnpm add -D codem
# yarn
$ yarn add -D codemConfig file can be one of the following:
codem.config.tscodem.config.mtscodem.config.jscodem.config.mjscodem.config.json
// codem.config.ts
import { defineConfig, VscodeChannel } from 'codem'
export default defineConfig({
// Use stable or insider channel
channel: VscodeChannel.Stable,
// Specify VSCode version (optional)
version: '1.96.1'
// Or use a specific commit hash from microsoft/vscode repository (takes precedence over version)
// commit: '123abc...',
// The output directory for downloaded VSCode files
output: './public/vscode'
})npx codem// import entry from the codem ${output}/index.js
import workbench from '/vscode/index.js'
await workbench.create(window.document.body, {
// vscode workbench construction options
productConfiguration: {
nameShort: "VSCode",
nameLong: "VSCode in My Project",
applicationName: "vscode-in-my-project",
dataFolderName: ".vscode-in-my-project",
version: "1.0.0",
},
// ... other options
})See Web Workbench API for more available options.
MIT License