-
Notifications
You must be signed in to change notification settings - Fork 117
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 ES modules for public CDN #788
Comments
greetings friends! 👋 i don't know what kind of 🤸 it would take to get the TypeScript compiler to generate flat ES Module output, but it doesn't take much to convince rollup to do it. prior art: https://github.com/terraformer-js/terraformer/tree/master/packages/arcgis#es-module-in-the-browser |
@jgravois Thanks for the tip. I was going down this path but I hate that we end up with duplicating However I did find https://www.skypack.dev/ which basically looks like Unpkg for ES Modules. The best part it that it already works with our existing release AND doesn't seem to duplicate <script type="module">
import {request} from " https://cdn.skypack.dev/@esri/arcgis-rest-request@3.3.0?min"
import {createGroup} from " https://cdn.skypack.dev/@esri/arcgis-rest-portal@3.3.0?min"
console.log({request, createGroup});
</script> I think going forward we can just continue as we are with my 4.0 build refactor and point people to Skypack for ES modules and Unpkg for everything else without any extra builds or configuration. |
Looks like Skypack will also "pin" production ready URLs for us when we do a lookup https://docs.skypack.dev/skypack-cdn/api-reference/pinned-urls-optimized so we can/should call Skypack when we do a ready and we can generate the pinned URLS and include them in the doc. |
I would love to be able to write examples in pure ES modules without a compiler and publish them on the CDN.
Or via import maps https://github.com/WICG/import-maps
It would probally take a bit of R & D to figure out how to make Typescript do this.
The text was updated successfully, but these errors were encountered: