mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-26 10:43:51 -05:00
Remove dynamicImport and setDynamicImport
It turns out that the import expression won't actally be rewritten by esbuild, so we can just write it directly. While this won't help CJS emit, that already didn't work anyway, and it's likely that this code is going to be moved outside of the codebase into VS Code or a shared package elsewhere anyway.
This commit is contained in:
@@ -125,15 +125,6 @@ export class MainProcessLogger extends BaseLogger {
|
||||
}
|
||||
}
|
||||
|
||||
let dynamicImport = async (_id: string): Promise<any> => {
|
||||
throw new Error("Dynamic import not implemented");
|
||||
};
|
||||
|
||||
/** @internal */
|
||||
export function setDynamicImport(fn: (id: string) => Promise<any>) {
|
||||
dynamicImport = fn;
|
||||
}
|
||||
|
||||
/** @internal */
|
||||
export function createWebSystem(host: WebHost, args: string[], getExecutingFilePath: () => string): ServerHost {
|
||||
const returnEmptyString = () => "";
|
||||
@@ -182,7 +173,7 @@ export function createWebSystem(host: WebHost, args: string[], getExecutingFileP
|
||||
|
||||
const scriptPath = combinePaths(packageRoot, browser);
|
||||
try {
|
||||
const { default: module } = await dynamicImport(scriptPath);
|
||||
const { default: module } = await import(scriptPath);
|
||||
return { module, error: undefined };
|
||||
}
|
||||
catch (e) {
|
||||
|
||||
Reference in New Issue
Block a user