I'm creating a big big vue 3 library with Vite and Typescript. I'm trying to have the most optimized app for the final build. I don't understant whats the difference beetween importing from the lib or directly the file from the lib.
Like for example, it is better to import like that :
import Comp from '@mylib/entrypoint'
Or like that :
import Comp from 'node_modules/@mylib/.../Comp.vue'
I've tried both and I seem to win some little kb with the second method but i dont know if it is worth the price, can somebody explain please thanks !
node_moduleshere, justimport Comp from '@mylib/.../Comp.vue'. It should be the same size if it's ES moduleimport Comp from '@mylib/entrypoint'is already shorthand forimport Comp from 'node_modules/@mylib/entrypoint'. There is no difference.