Valentyne Stigloher b25afefc49 (fmt)
2024-10-29 10:56:32 +01:00

17 lines
580 B
JavaScript

import { pathToFileURL } from 'url';
import { resolve as resolveTs } from 'ts-node/esm.mjs';
import { loadConfig, createMatchPath } from 'tsconfig-paths';
const { absoluteBaseUrl, paths } = loadConfig('.nuxt');
const matchPath = createMatchPath(absoluteBaseUrl, paths);
export async function resolve(specifier, ctx, defaultResolve) {
const match = matchPath(specifier);
return match
? resolveTs(pathToFileURL(`${match}`).href, ctx, defaultResolve)
: resolveTs(specifier, ctx, defaultResolve);
}
export { load, transformSource } from 'ts-node/esm.mjs';