// Resolve TypeScript's extensionless ESM output for source-level Node gates. // Production is bundled by Vite; this loader gives the gate the same ESM semantics without // pretending the valid `import.meta.url` worker code is CommonJS. export async function resolve(specifier, context, nextResolve) { try { return await nextResolve(specifier, context); } catch (error) { if (specifier.startsWith(".") && !/\.[cm]?js(?:[?#]|$)/.test(specifier)) { return nextResolve(`${specifier}.js`, context); } throw error; } }