mirror of
https://gitlab.com/PronounsPage/PronounsPage.git
synced 2025-08-03 02:56:45 -04:00
17 lines
580 B
JavaScript
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';
|