Skip to content

How to apply resolve.extensions for dependencies? #18229

Closed Answered by hyperstown
hyperstown asked this question in Q&A
Discussion options

You must be logged in to vote

Kinda late but anyway, here is a solution I ended up with:

imports:

-import VueUploadMultipleImage from 'vue-upload-multiple-image'
+import VueUploadMultipleImage from "vue-upload-multiple-image/src/components/VueUploadMultipleImage.vue";

vite.config.js

optimizeDeps: {
    exclude: ['vue-image-lightbox-carousel'],
    include: ['vue-awesome-swiper']
  },

Since package used both imports with and without extensions I had to specify each dependency in include and exclude.
Thanks @hi-ogawa for the hint!

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by hyperstown
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants