Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid bundling ol imports into the final build #272

Merged
merged 3 commits into from
Sep 19, 2023

Conversation

menghany
Copy link

No description provided.

@jonataswalker
Copy link
Owner

This is great but the iife bundle have some problems.

You'll see if you run examples/contextmenu.html. Making some tests it looks like that this change can fix it:

rollupOptions: {
    external: [/^ol.*/],
    output: {
        globals: {
            'ol/MapBrowserEvent': 'ol.MapBrowserEvent',
            'ol/control/Control': 'ol.control.Control',
        },
        assetFileNames: () => 'ol-contextmenu.css',
    },
},

@jonataswalker jonataswalker merged commit b615ce8 into jonataswalker:master Sep 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants