-
Notifications
You must be signed in to change notification settings - Fork 144
Build module as stand alone plugin for Vue/ol using umd #427
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
Comments
OK, so it does look like it's a build config issue. Here's what I had to do to get a useable umd:
So, notes: globals:
output
lib.fileName
So I believe this could be made as a separate output. Might be worth minifying the output then it might not interfere with existing users. |
Hey, would you like to send a PR? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Is your feature request related to a problem? Please describe.
I'm trying to build a page without a bundler and importing scripts like:
Describe the solution you'd like
vue3-openlayers.umd.cjs does not import as a umd module usually does because commonjs isn't used by browsers. I tried the ESM module, but the stack above (quasar, et al) would all need to be re worked. Future libraries would also be limited to ESM.
If I could use a script vue3-openlayers and introduce my vue app and inject the necessary open layers packages, it should work.
Describe alternatives you've considered
The alternative is to find ESM versions of all the libraries I'm using now and in the future. Typically, there's not much needed to get a UMD module, but there needs to be a bootstrap pointing to the correct libraries (vue, ol) or checking globals. When using vue in umd the global is Vue. When using openlayers the global is ol.
It looks like we'd need to augment: https://github.com/MelihAltintas/vue3-openlayers/blob/main/src/index.ts and create some kind of loader function from global variables. I'm not versed in typescript.
I can provide a working template to test if needed.
The text was updated successfully, but these errors were encountered: