mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-27 20:13:32 +01:00
Fixes vite hotreload workers (#289767)
This commit is contained in:
committed by
GitHub
parent
ae07f4d700
commit
f71d8d43f3
@@ -6,13 +6,25 @@
|
||||
/// <reference path="../../src/typings/vscode-globals-product.d.ts" />
|
||||
|
||||
import { enableHotReload } from '../../src/vs/base/common/hotReload.ts';
|
||||
import { InstantiationType, registerSingleton } from '../../src/vs/platform/instantiation/common/extensions.ts';
|
||||
import { getSingletonServiceDescriptors, InstantiationType, registerSingleton } from '../../src/vs/platform/instantiation/common/extensions.ts';
|
||||
import { IWebWorkerService } from '../../src/vs/platform/webWorker/browser/webWorkerService.ts';
|
||||
// eslint-disable-next-line local/code-no-standalone-editor
|
||||
import { StandaloneWebWorkerService } from '../../src/vs/editor/standalone/browser/services/standaloneWebWorkerService.ts';
|
||||
|
||||
enableHotReload();
|
||||
|
||||
registerSingleton(IWebWorkerService, StandaloneWebWorkerService, InstantiationType.Eager);
|
||||
const descriptors = getSingletonServiceDescriptors();
|
||||
|
||||
// Patch push to ignore future IWebWorkerService registrations.
|
||||
// This is hot-reload dev only, so it is fine.
|
||||
const originalPush = descriptors.push;
|
||||
descriptors.push = function (item: any) {
|
||||
if (item[0] === IWebWorkerService) {
|
||||
return this.length;
|
||||
}
|
||||
return originalPush.call(this, item);
|
||||
};
|
||||
|
||||
globalThis._VSCODE_DISABLE_CSS_IMPORT_MAP = true;
|
||||
globalThis._VSCODE_USE_RELATIVE_IMPORTS = true;
|
||||
|
||||
Reference in New Issue
Block a user