From 7463e5b360e2f0045520ef62fd3b3018858e6f0f Mon Sep 17 00:00:00 2001 From: kittisakLS <85727452+kittisakLS@users.noreply.github.com> Date: Tue, 14 Nov 2023 00:49:47 -0800 Subject: [PATCH] feat(nuxt): remove nuxt page from component profile (#58) --- src/vue-scanner.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/vue-scanner.ts b/src/vue-scanner.ts index f4b1cc2..23b1847 100644 --- a/src/vue-scanner.ts +++ b/src/vue-scanner.ts @@ -977,7 +977,12 @@ export class VueScanner implements Scanner { vueModule: vueCompilerMod as CompilerSFC, babelModule: babelParserMod as BabelParser, }); - if ([".vue", ".jsx", ".tsx"].includes(extname(filePath))) { + const isInNuxtPages = + nuxtVersion && filePath.includes(`${this.scanPath}/pages`); + const isComponentFile = [".vue", ".jsx", ".tsx"].includes( + extname(filePath) + ); + if (isComponentFile && !isInNuxtPages) { // assume it is component, store all file into `componentFiles` const name = parse(filePath).name; componentFiles.push({ name, filePath }); @@ -1156,7 +1161,7 @@ export class VueScanner implements Scanner { this.mapComponentProfileProps(filePathToProperties); if (existsSync(join(this.scanPath, ".git"))) { // Use Git Scan - // await this.scanGit(); + await this.scanGit(); } if (this.option?.output) {