unplugin-vue-components icon indicating copy to clipboard operation
unplugin-vue-components copied to clipboard

auto import components with vuetify

Open Karrrrrrrr opened this issue 2 years ago • 2 comments

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

  • [X] Follow our Code of Conduct
  • [X] Read the Contributing Guide.
  • [X] Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
  • [X] Check that this is a concrete bug. For Q&A, please open a GitHub Discussion instead.
  • [X] The provided reproduction is a minimal reproducible of the bug.

Karrrrrrrr avatar May 21 '23 06:05 Karrrrrrrr

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

lishaobos avatar May 31 '23 03:05 lishaobos

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

okok 谢谢

Karrrrrrrr avatar Jun 03 '23 12:06 Karrrrrrrr