Skip to content
This repository has been archived by the owner on Apr 6, 2023. It is now read-only.

Commit

Permalink
refactor: sort by group
Browse files Browse the repository at this point in the history
  • Loading branch information
pi0 committed Aug 9, 2022
1 parent d0093ad commit d5f31ac
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions packages/nuxt/src/components/module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,11 @@ export default defineNuxtModule<ComponentsOptions>({
transpile: (transpile === 'auto' ? dirPath.includes('node_modules') : transpile)
}
}).filter(d => d.enabled)
.sort(dir => dir.path.includes('node_modules') ? 1 : -1)
.sort(dir => dir.path.includes('global') && !dir.path.includes('node_modules') ? -1 : 1)

componentDirs = [
...componentDirs.filter(dir => !dir.path.includes('node_modules')),
...componentDirs.filter(dir => dir.path.includes('node_modules'))
]

nuxt.options.build!.transpile!.push(...componentDirs.filter(dir => dir.transpile).map(dir => dir.path))
})
Expand Down

0 comments on commit d5f31ac

Please sign in to comment.