MelihAltintas / vue3-openlayers

Web map Vue 3.x components with the power of OpenLayers
https://vue3openlayers.netlify.app/
MIT License
678 stars 125 forks source link

Client bundle size (Nuxt) #378

Open nonlinearcom opened 1 month ago

nonlinearcom commented 1 month ago

Hi, after adding vue3-openlayers as a plugin to a clean Nuxt project, the client bundle shows a large file (vue3-openlayers.es.js) of over 1MB. The same issue occurs when performing selected imports, like import { Map, Layers, Sources } from "vue3-openlayers (975 KB).

Is it possible to reduce the size of the bundled package? 🤔

├── ol-contextmenu@5.5.0
├── ol-ext@4.0.23
├── ol@10.1.0
├── vue@3.4.38 invalid: "latest" from the root project
└── vue3-openlayers@11.1.0

To Reproduce Steps to reproduce the behavior:

Reproduction repo

Run npx nuxi analyze

Screenshots

Screenshot 2024-08-29 at 16 22 46
YXYH-12138 commented 3 weeks ago

Yes, I have encountered the same issue, and this library cannot be tree-shaken.🤔

d-koppenhagen commented 3 weeks ago

Hey, would like to contribute and refactor it? I think it would be acceptable if a Breaking Change is introduced. The best in my opinion would be to allow to import / load components individually and therefore expose them.