vue-email / nuxt

💚 Official Nuxt module for Vue Email. Build email templates with Vue components.
https://vuemail.net/getting-started/nuxt-nitro
MIT License
110 stars 3 forks source link

Why is vue-email included in the client bundle when using Nuxt? #6

Closed UfukUstali closed 11 months ago

UfukUstali commented 1 year ago

Issue Description

When using Nuxt and running nuxt analyze, it is reported that the vue-email files are included in the client bundle, even though they are only used under the server folder (and not imported in any file that would be sent to the client). This issue is impacting the loading time significantly, as these files measure up to around 500kB in the entry.js file, which is as the name implies the entry file for the whole website and is blocking (atleast from what I could observe through the Lighthouse reports).

Expected Behavior

The vue-email package should not be included in the client bundle and operate only server side.

Additional Information

Screenshots or Output

As you can see in the below example while the entire screenshot is entry.js (925.57kB) and the blue outlined part is everything that vue-email includes (488.22kB) which covers 52.75% of the the entry.js file. These numbers are reported by Nuxt. Ekran görüntüsü 2023-10-11 171806

Dave136 commented 1 year ago

We'll work on improve this.

Thanks for your comment!

barnabastoth commented 1 year ago

Any other workarounds for now? If I install in my nuxt (nitro) app as in node js, it works locally, but when deployed it can not resolve the relative path

Dave136 commented 1 year ago

@barnabastoth can you show me what are u doing? To have better context

Flowko commented 11 months ago

hi, added autoImport option to the vueEmail config, thats false by default, meaning components/composables from vue-email wont be imported in the client, and it will be fine in the server side, the overall size now should be fine on version 0.8.1