vuetifyjs / vuetify-loader

📦 Webpack and Vite plugins for treeshaking Vuetify components and more
https://vuetifyjs.com/customization/a-la-carte#vuetify-loader
MIT License
516 stars 91 forks source link

[Feature Request] Export list of API for auto import #294

Open kingyue737 opened 1 year ago

kingyue737 commented 1 year ago

I want to use Vuetify 3 APIs like useTheme without manually importing, via unplugin-auto-import. It's a little cumbersome to add Vuetify's APIs to plugin's config in each of my Vuetify project. I wonder if the official plugin of Vuetify can export this preset.

I once opened a PR https://github.com/unjs/unimport/pull/225#issuecomment-1455478331 but the maintainer thought it might be better to have Vuetify to provide the list.

As shown in the example of unplugin-vue-router, we might use Vuetify API preset like this:

import { defineConfig } from 'vite'
import AutoImport from 'unplugin-auto-import/vite'
import { vuetifyAutoImports } from 'vite-plugin-vuetify'

 export default defineConfig({
   plugins: [
     // other plugins
     AutoImport({
       imports: [
         vuetifyAutoImports,
       ],
     }),
   ],
 })
chunfenghuayu1 commented 1 year ago

我的建议是换一个组件库,太麻烦了

tjhiggins commented 11 months ago

Would like this for useDate() as well