Skip to content

feat(dir)!: support glob pattern in dirs - #86

Merged
antfu merged 1 commit into
mainfrom
feat/dir-glob
Jul 21, 2022
Merged

antfu merged 1 commit into
mainfrom
feat/dir-glob

Conversation

@antfu

@antfu antfu commented Jul 6, 2022

Copy link
Copy Markdown
Member

@antfu antfu changed the title feat(dir): support glob pattern in dirs feat(dir)!: support glob pattern in dirs Jul 8, 2022
@antfu

antfu commented Jul 8, 2022

Copy link
Copy Markdown
Member Author

Discussion:

Not sure if we should include */index.{ts,js,mjs,cjs,mts,cts} by default, which make it less intuitive and make it complex to explain (https://v3.nuxtjs.org/guide/directory-structure/composables#how-files-are-scanned cc @danielroe)

I propose we remove the scanning for one level deep's index. Instead, with this PR, user could set

dirs: [
  'composables/*', // one level
  'composables/**', // all nested
  'composables/*/auto-imported', // more specific
]

to have nested auto scanning

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

why auto import didn't support pattern like 'src/modules/xx/services'

1 participant