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

feat: ant-design-vue 4.x support

Open JohnsonHuang4396 opened this issue 2 years ago • 6 comments

Description

Support Ant-Design Vue 4.x

Previously, AntDesignVueResolver could only import CSS files, but now supports the introduction of CSS inJS files

Linked Issues

Additional context

JohnsonHuang4396 avatar Sep 27 '23 04:09 JohnsonHuang4396

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

Found this is no need ToT

JohnsonHuang4396 avatar Sep 27 '23 04:09 JohnsonHuang4396

I upgraded to ant-design-vue v4 and had an error:

[vite]: Rollup failed to resolve import "ant-design-vue/es/config-provider/style/css" from "D:/src/App.vue?vue&type=
script&setup=true&lang.ts".
This is most likely unintended because it can break your application at runtime.
If you do want to externalize this module explicitly add it to
`build.rollupOptions.external`

Now I using the less import style to fix it temporarily:

AntDesignVueResolver({
  importStyle: 'less',
}),

I think this PR could fix it, @JohnsonHuang4396 could you reopen it?

ycs77 avatar Nov 13 '23 09:11 ycs77

And now the ant-design-vue latest version is v4, could you set the importStyle default to CSSinJS?

ycs77 avatar Nov 13 '23 09:11 ycs77

I'm glad that this PR is helpful to you, but I think the CSSinJS option is exactly the same as the Less option, just with different name. But I can't figure out a better way, so I closed this PR. Maybe you could give me some clue?🧐

JohnsonHuang4396 avatar Nov 14 '23 00:11 JohnsonHuang4396

Thanks for the response. I think that although the functionality is the same, the option value still has meaning to the user. Just like for package users "less" and "CSSinJS" are different. 🤔

ycs77 avatar Nov 14 '23 02:11 ycs77