Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vite还是不能组件按需引入吗?手动引入后打包有2M多 #1804

Closed
986823307 opened this issue Oct 31, 2022 · 7 comments
Closed
Assignees
Labels
good first issue Good for newcomers

Comments

@986823307
Copy link

What problem does this feature solve?(这个功能解决的问题)

手动引入和打包资源过大的问题

What does the proposed API look like?(期望的 API)

希望能改下组件引入的形式

@yanbowe
Copy link

yanbowe commented Nov 1, 2022

强烈建议使用unplugin-vue-components @richard1015

@986823307
Copy link
Author

强烈建议使用unplugin-vue-components @richard1015

用的就是这个,但是还没有resolvers,自定义的resolvers会导致组件异常

@eiinu
Copy link
Member

eiinu commented Nov 3, 2022

强烈建议使用unplugin-vue-components @richard1015

用的就是这个,但是还没有resolvers,自定义的resolvers会导致组件异常

样式文件缺少依赖关系,如果 A 组件内部使用了 B 组件,使用 unplugin 插件自动导入的只有 A 的样式

@yanbowe
Copy link

yanbowe commented Nov 3, 2022

强烈建议使用unplugin-vue-components @richard1015

用的就是这个,但是还没有resolvers,自定义的resolvers会导致组件异常

样式文件缺少依赖关系,如果 A 组件内部使用了 B 组件,使用 unplugin 插件自动导入的只有 A 的样式

主要是需要组件可以自动引入注册有TS提示,样式的话可以手动全部导入,因为我觉得unplugin-vue-components导入样式有问题,例如vant样式导入

@richard1015 richard1015 added the good first issue Good for newcomers label Nov 3, 2022
@richard1015
Copy link
Contributor

eiinu 大佬已经在解决依赖性,样式丢失问题,大家敬请期待

@eiinu eiinu moved this from Todo to In Progress in nutui-vue 社区任务列表 Nov 8, 2022
@Kareshii
Copy link

Pin一个unplugin-vue-components 引入

@eiinu
Copy link
Member

eiinu commented Jan 18, 2023

4.0 版本已支持 unplugin-vue-components 插件

@eiinu eiinu closed this as completed Jan 18, 2023
@github-project-automation github-project-automation bot moved this from In Progress to Done in nutui-vue 社区任务列表 Jan 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

5 participants