Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/vs/workbench/api/common/extHostExtensionService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1087,7 +1087,7 @@ export abstract class AbstractExtHostExtensionService extends Disposable impleme
}

protected _isESM(extensionDescription: IExtensionDescription | undefined, modulePath?: string): boolean {
modulePath ??= extensionDescription?.main;
modulePath ??= extensionDescription ? this._getEntryPoint(extensionDescription) : modulePath;
return modulePath?.endsWith('.mjs') || (extensionDescription?.type === 'module' && !modulePath?.endsWith('.cjs'));
}

Expand Down
4 changes: 3 additions & 1 deletion src/vs/workbench/api/worker/extHostExtensionService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import { IExtensionDescription } from '../../../platform/extensions/common/exten
import { ExtensionRuntime } from '../common/extHostTypes.js';
import { timeout } from '../../../base/common/async.js';
import { ExtHostConsoleForwarder } from './extHostConsoleForwarder.js';
import { extname } from '../../../base/common/path.js';

class WorkerRequireInterceptor extends RequireInterceptor {

Expand Down Expand Up @@ -147,5 +148,6 @@ export class ExtHostExtensionService extends AbstractExtHostExtensionService {
}

function ensureSuffix(path: string, suffix: string): string {
return path.endsWith(suffix) ? path : path + suffix;
const extName = extname(path);
return extName ? path : path + suffix;
}
Loading