unplugin / unplugin-vue-components

📲 On-demand components auto importing for Vue
https://www.npmjs.com/package/unplugin-vue-components
MIT License
3.65k stars 341 forks source link

Auto import only primevue components #734

Closed pdmshrestha closed 5 months ago

pdmshrestha commented 5 months ago

I would like to auto import only primeview components but not my local components.

import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import Components from 'unplugin-vue-components/vite';
import {PrimeVueResolver} from 'unplugin-vue-components/resolvers';

// https://vitejs.dev/config/
export default defineConfig({
  plugins: [
    vue(),
    Components({
     include: [], //  <--  What should I add here?
    exclulde: [], // <-- or here
      resolvers: [
        PrimeVueResolver()
      ]
    })]
})
pdmshrestha commented 5 months ago

Solved! use globs instead of exclude or include

      globs: "!src/**/.vue",