-
-
Notifications
You must be signed in to change notification settings - Fork 367
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
feat: add an option for pre-built components #291
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Name has been changed.
I don't really like this approach and would think making deps optimization for components is out-of-scope of this project. I feel it's better to either be handled by another plugin, provide on the user side, or for libraries like antdv and vant to ship the ESM version directly. |
I actually added this option to fix that, after unplugin-vue-components imported components from the UI library (I use antdv ESM) on demand, vite always found a new style dependency (css or less in antdv) and repeatedly reloaded the page, causing it to load very slowly. [vite] new dependencies found: ant-design-vue/es/divider/style, ant-design-vue/es/popover/style, updating...
[vite] ✨ dependencies updated, reloading page...
//......
[vite] new dependencies found: ant-design-vue/es/spin/style, updating...
[vite] ✨ dependencies updated, reloading page...
I actually have two solutions
Anyway, thanks for your comments! If you still feel that this PR is not suitable, please close it. Best regards. |
To avoid infinite reloads caused by the introduction of dynamic components, add an option to make vite add the specified UI component library to optimizeDeps.include in the 'config' lifecycle for all prebuilds. #235 #255
(This PR is for antdv resolver and vant resolver)