Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
microsoft
GitHub Repository: microsoft/vscode
Path: blob/main/build/vite/setup-dev.ts
5256 views
1
/*---------------------------------------------------------------------------------------------
2
* Copyright (c) Microsoft Corporation. All rights reserved.
3
* Licensed under the MIT License. See License.txt in the project root for license information.
4
*--------------------------------------------------------------------------------------------*/
5
6
/// <reference path="../../src/typings/vscode-globals-product.d.ts" />
7
8
import { enableHotReload } from '../../src/vs/base/common/hotReload.ts';
9
import { getSingletonServiceDescriptors, InstantiationType, registerSingleton } from '../../src/vs/platform/instantiation/common/extensions.ts';
10
import { IWebWorkerService } from '../../src/vs/platform/webWorker/browser/webWorkerService.ts';
11
// eslint-disable-next-line local/code-no-standalone-editor
12
import { StandaloneWebWorkerService } from '../../src/vs/editor/standalone/browser/services/standaloneWebWorkerService.ts';
13
14
enableHotReload();
15
16
registerSingleton(IWebWorkerService, StandaloneWebWorkerService, InstantiationType.Eager);
17
const descriptors = getSingletonServiceDescriptors();
18
19
// Patch push to ignore future IWebWorkerService registrations.
20
// This is hot-reload dev only, so it is fine.
21
const originalPush = descriptors.push;
22
descriptors.push = function (item: any) {
23
if (item[0] === IWebWorkerService) {
24
return this.length;
25
}
26
return originalPush.call(this, item);
27
};
28
29
globalThis._VSCODE_DISABLE_CSS_IMPORT_MAP = true;
30
globalThis._VSCODE_USE_RELATIVE_IMPORTS = true;
31
32