(base: string | URL)
| 104 | * Create a relative resolver |
| 105 | */ |
| 106 | export function createResolver (base: string | URL): Resolver { |
| 107 | if (!base) { |
| 108 | throw new Error('`base` argument is missing for createResolver(base)!') |
| 109 | } |
| 110 | |
| 111 | base = base.toString() |
| 112 | if (base.startsWith('file://')) { |
| 113 | base = dirname(fileURLToPath(base)) |
| 114 | } |
| 115 | |
| 116 | return { |
| 117 | resolve: (...path) => resolve(base as string, ...path), |
| 118 | resolvePath: (path, opts) => resolvePath(path, { cwd: base as string, ...opts }), |
| 119 | } |
| 120 | } |
| 121 | |
| 122 | export async function resolveNuxtModule (base: string, paths: string[]): Promise<string[]> { |
| 123 | const resolved: string[] = [] |
no test coverage detected
searching dependent graphs…