Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(建议) 能否增加ignore配置 #578

Open
UphkcRNqmafQWcSSSSSS opened this issue Jan 10, 2023 · 5 comments
Open

(建议) 能否增加ignore配置 #578

UphkcRNqmafQWcSSSSSS opened this issue Jan 10, 2023 · 5 comments

Comments

@UphkcRNqmafQWcSSSSSS
Copy link

比如
/components/button/index.vue
/components/button/components/loading.vue

"/components/button/components/loading.vue"是button子组件并不想暴露给用户

https://github.com/antfu/unplugin-vue-components/blob/05196ec4d82566058585234dcad00c90787a490e/src/core/fs/glob.ts#L12

// 能否增加一个配置,方便过滤不需要的组件呢?
// ignore: ['node_modules', '**/components']
const files = fg.sync(ctx.options.globs, {
    ignore: ctx.options.ignore || ['node_modules'],
    onlyFiles: true,
    cwd: root,
    absolute: true,
  })
@cMing1997
Copy link

可以配置的吧,虽然不是 ignore ,但是配合 include 和 exclude 应该也可以达到你想要的那个效果吧,按照文档配置是这么说的

@lishaobos
Copy link
Contributor

这个 pr 通过后可以配置 globs = [ !components/button/components/loading.vue ], 前面加 ! 排除文件

@cnjm
Copy link

cnjm commented Jun 20, 2023

我觉得这个功能使用场景还是挺多的,如果能像uniapp 的easycom这样配置就更好用了

@AprilLemon
Copy link

AprilLemon commented Mar 9, 2024

  globs: [
    // '!src/components/**/modules/*.vue',
    'src/components/*.vue',
    'src/components/**/index.vue',
  ],

可以参考这种方式来匹配

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

No branches or pull requests

5 participants