esm tweaks: amdX and web EH (#226417)

* no more require.paths in amdX

* fix web worker script hash
This commit is contained in:
Johannes Rieken
2024-08-23 13:33:25 +02:00
committed by GitHub
parent 3d4e5ab91a
commit 19d2a58852
-9
View File
@@ -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)!;