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

Build incompatible with modern frameworks #683

Closed
samuel-girard opened this issue Dec 4, 2018 · 4 comments
Closed

Build incompatible with modern frameworks #683

samuel-girard opened this issue Dec 4, 2018 · 4 comments

Comments

@samuel-girard
Copy link
Contributor

Hello,

I have some issues with the current build of ol-cesium, when using it inside Angular application.
My problem is similar with what I found in other open issues:

I have found a setup that makes me able to use the library perfectly fine in my application: samuel-girard@0702549
But I don't know if this config is fine for other people using ol-cesium.

I cannot use olcs package, because Angular does not let me customize Webpack setup, so the only solution is to provide a library that is already built.

@gberaudo, what is your opinion on:

  • either change the build with the modification I made
  • either if this breaks other application setups, create another dist that would be more Angular-compatible. In this case, the new dist can still be built in the same ol-cesium npm package (for example, Angular libraries export multiple builds, with "esm5", "esm2015" keys in package.json to differentiate them.
@gberaudo
Copy link
Member

gberaudo commented Dec 5, 2018

@samuel-girard, yes it will break the "legacy build" use case.
For the legacy build to work the imports to OpenLayers must be rewritten. For example import .. 'ol/source/OSM.js' must become window.ol.source.OSM.

It is unfortunate the JS world is becoming even more complicate than before. With more and more tricky/legacy cases instead of converging to the ES6 standard.

The OL-Cesium library is small and building it is fast. So I am OK with adding a new "legacy" build to handle your use case. Would you be able to create a PR for it?

@gberaudo
Copy link
Member

gberaudo commented Dec 5, 2018

For the context and current workaround in Angular cli: angular/angular-cli#10618.

@samuel-girard
Copy link
Contributor Author

Thanks for the info.
I do agree that JS library builds are getting more complicated if you have to consider all possible usages.

I will try to get back soon with a PR that solve the integration with Angular.

@samuel-girard
Copy link
Contributor Author

Fixed by #685

@fredj fredj closed this as completed Apr 25, 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

No branches or pull requests

3 participants