mirror of
https://github.com/microsoft/vscode.git
synced 2026-05-26 18:27:38 +01:00
esm tweaks: amdX and web EH (#226417)
* no more require.paths in amdX * fix web worker script hash
This commit is contained in:
@@ -179,11 +179,6 @@ class AMDModuleImporter {
|
||||
|
||||
const cache = new Map<string, Promise<any>>();
|
||||
|
||||
let _paths: Record<string, string> = {};
|
||||
if (typeof globalThis.require === 'object') {
|
||||
_paths = (<Record<string, any>>globalThis.require).paths ?? {};
|
||||
}
|
||||
|
||||
/**
|
||||
* Utility for importing an AMD node module. This util supports AMD and ESM contexts and should be used while the ESM adoption
|
||||
* is on its way.
|
||||
@@ -198,10 +193,6 @@ export async function importAMDNodeModule<T>(nodeModuleName: string, pathInsideN
|
||||
isBuilt = Boolean((product ?? (globalThis as any).vscode?.context?.configuration()?.product)?.commit);
|
||||
}
|
||||
|
||||
if (_paths[nodeModuleName]) {
|
||||
nodeModuleName = _paths[nodeModuleName];
|
||||
}
|
||||
|
||||
const nodeModulePath = pathInsideNodeModule ? `${nodeModuleName}/${pathInsideNodeModule}` : nodeModuleName;
|
||||
if (cache.has(nodeModulePath)) {
|
||||
return cache.get(nodeModulePath)!;
|
||||
|
||||
Reference in New Issue
Block a user