Skip to content

Commit

Permalink
feat(nuxt): remove nuxt page from component profile (#58)
Browse files Browse the repository at this point in the history
  • Loading branch information
kittisakLS committed Nov 14, 2023
1 parent 6b8a273 commit 7463e5b
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/vue-scanner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 });
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit 7463e5b

Please sign in to comment.