blob: f437c77a5610441d7c1d4a197e1f2662f530020f [file] [edit]
// Copyright 2026 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
export async function resolve(specifier, context, nextResolve) {
try {
return await nextResolve(specifier, context);
} catch (err) {
if (specifier.endsWith('.js')) {
const tsSpecifier = specifier.slice(0, -3) + '.ts';
try {
return await nextResolve(tsSpecifier, context);
} catch {
// Fall back to original error
}
}
throw err;
}
}