mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-11 08:33:53 +00:00
perf(kit): avoid duplicate join
operation (#24717)
This commit is contained in:
parent
a250ca9ef1
commit
1711c33be4
@ -70,8 +70,9 @@ export async function loadNuxtModuleInstance (nuxtModule: string | NuxtModule, n
|
|||||||
nuxtModule = await importModule(src, nuxt.options.modulesDir).catch(() => null) ?? requireModule(src, { paths: nuxt.options.modulesDir })
|
nuxtModule = await importModule(src, nuxt.options.modulesDir).catch(() => null) ?? requireModule(src, { paths: nuxt.options.modulesDir })
|
||||||
|
|
||||||
// nuxt-module-builder generates a module.json with metadata including the version
|
// nuxt-module-builder generates a module.json with metadata including the version
|
||||||
if (existsSync(join(dirname(src), 'module.json'))) {
|
const moduleMetadataPath = join(dirname(src), 'module.json')
|
||||||
buildTimeModuleMeta = JSON.parse(await fsp.readFile(join(dirname(src), 'module.json'), 'utf-8'))
|
if (existsSync(moduleMetadataPath)) {
|
||||||
|
buildTimeModuleMeta = JSON.parse(await fsp.readFile(moduleMetadataPath, 'utf-8'))
|
||||||
}
|
}
|
||||||
break
|
break
|
||||||
} catch (_err: unknown) {
|
} catch (_err: unknown) {
|
||||||
|
Loading…
Reference in New Issue
Block a user