unplugin / unplugin-vue-components

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

auto import components with vuetify #634

Open Karrrrrrrr opened 1 year ago

Karrrrrrrr commented 1 year ago

Describe the bug

引入vuetify的时候, 源码是直接引入"vuetify/components"的, 但是这个文件下有很多不必要的引入, 在开发环境中会引入很多不想干的css,

建议把这个代码修改成下面的, 在开发环境下不会引入其他css

function Vuetify3Resolver() {
    return {
        type: "component",
        resolve: (name) => {
            if (name.match(/^V[A-Z]/))
                return {name, from: "vuetify/components"};
        }
    };
}
function Vuetify3Resolver() {
    return {
        type: "component",
        resolve: (name) => {
            if (name.match(/^V[A-Z]/))
                return {name, from: "vuetify/components/"+ name};
        }
    };
} 

0bcf5ea589c49f12517d72b369dfaf8 image

Reproduction

asd

System Info

windows 10

Used Package Manager

pnpm

Validations

lishaobos commented 1 year ago

现在可以使用建议的插件:vite-plugin-vuetify

Karrrrrrrr commented 1 year ago

现在可以使用建议的插件:vite-plugin-vuetify

okok 谢谢