Typst WASM Compiler is a VS Code web extension that compiles .typ files to PDF in the browser using typst.ts. It is intended to run in vscode.dev and github.dev without a server-side compiler.
Features
Compile the active Typst document to a sibling PDF file with Typst: Compile to PDF.
Resolve local #import, #include, and asset reads from the current workspace.
Choose between automatic, single-file, and project compile modes.
Recompile Typst files to sibling PDF files on save when typst-wasm.compileOnSave is enabled.
Fall back to a Save As dialog when the workspace provider cannot write the sibling PDF.
Scope
This MVP compiles the active .typ document to document.pdf. In auto mode it uses a fast single-file compile for standalone documents and switches to a workspace snapshot when the document appears to reference local imports, includes, data files, bibliographies, or images. Language server features, diagnostics, autocomplete, preview panels, and Typst package registry integration are out of scope for this simplified pass.
Development
Install dependencies:
npm install
Build the web extension:
npm run build
Run it in browser-based VS Code:
npm run test-web
If the browser opens to a blank page, clear the cached VS Code web build and run the command again:
rm -rf .vscode-test-web
npm run test-web
Settings
typst-wasm.compileOnSave: automatically compile Typst files to sibling PDFs on save.
typst-wasm.compileMode: controls compile context.
auto: fast single-file compile unless local file references are detected.
single-file: active document only.
project: workspace snapshot for local imports, includes, and assets.