mirror of
https://github.com/microsoft/vscode.git
synced 2026-05-03 15:01:57 +01:00
Don't include dom typings in extensions (#89942)
**Problem** All of our extensions currently are built using the dom typings. This can lead to runtime errors if you mistakenly use `window` or similar **Fix** Exclude the dom typings from compile. Then explicitly import the node types for `URL` and `TextEncoder`
This commit is contained in:
@@ -13,10 +13,14 @@
|
||||
//
|
||||
|
||||
import * as vscode from 'vscode';
|
||||
import { URL } from 'url';
|
||||
import { TextEncoder, TextDecoder } from 'util';
|
||||
|
||||
const textEncoder = new TextEncoder();
|
||||
const SCHEME = 'memfs';
|
||||
|
||||
declare const window: unknown;
|
||||
|
||||
export function activate(context: vscode.ExtensionContext) {
|
||||
if (typeof window !== 'undefined') { // do not run under node.js
|
||||
const memFs = enableFs(context);
|
||||
|
||||
Reference in New Issue
Block a user