vue-azure-maps icon indicating copy to clipboard operation
vue-azure-maps copied to clipboard

Duplicate `azure-maps-control` dependencies

Open maschill92 opened this issue 4 years ago • 3 comments

Our package.json includes both azure-maps-control and vue-azure-maps.

When inspecting our decency graph via "webpack bundle analyzer" I noticed that vue-azure-maps was quite sizable (larger than azure-maps-control even).

After digging into the files generated in the build for this project, it seems that azure-maps-control in it's entirety is included in the bundle.

img

My suspicion is that this is caused by import * as atlasJs from 'azure-maps-control/dist/atlas.min.js' in install.ts.

Why was this method of importing used vs import * as atlas from 'azure-maps-control'?

Additionally, the application imports azure-maps-control's CSS. Which results in duplicated CSS.

Any thoughts on this?

maschill92 avatar Feb 10 '21 16:02 maschill92

Vue 2 version of Vue Azure Maps imports the whole 'azure-maps-control' library, including the CSS. This is something that I already changed in the Vue 3 version (I have not made the Vue 3 version public yet, but I will as soon as I feel it's stable enough).

I do plan to add azure-maps-control as a peer dependency on the Vue 2 version and change the way global map options are handled. I've been too focused and busy at work, I've been postponing this breaking change for a while now, but I will try to publish this improvement on Saturday.

rickyruiz avatar Feb 12 '21 02:02 rickyruiz

Ok, great! The change you are talking about on Saturday is the Vue 2 version, correct?

maschill92 avatar Feb 12 '21 02:02 maschill92

@maschill92 Correct!

rickyruiz avatar Feb 12 '21 04:02 rickyruiz