-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Allow ESM imports from absolute urls #4148
Comments
My case is the JavaScript function call case, |
Any progress on this? If this feature is added, then we will be able to bundle and tree-shake Deno code (which uses URL imports), which could be useful for minimising size for Deno Deploy. As for whether it should download or leave it, that should most definitely be a user setting (e.g. Could this issue be solved with a resolver plugin? I looked into the docs, but it said that |
I stumbled upon this ticket because I'm preparing some changes in our web architecture and wanted to try out if my approach would even work and it seems it won't. I'd vote for importing it dynamically, during runtime as close to native Web API as possible as default. IMO this is what I'd expect from a bundler when importing with absolute https url. If I want something local I'd rather use npm or just copy something over. Also I guess it affects legal compliance in some companies (copying over some FOSS code vs importing it on demand by a user) Our use case: Currently we make parcel split them in chunks so they are fetched by the user on demand but having building this whole library over and over again on developers machines is a waste of time and resources. We plan to host them now on CDN and make the code fetch it from there - during runtime. EDIT: for people trying to find a workaround, this still works (as documented in related issue and parceljs docs): source:
output:
|
Update, the workaround only works in For |
Please fix this, for a quick code example this is mandatory, we are in 2023 and ESM modules loading by URL is becoming standard. |
At least in my case (and I am guessing most cases) I would add the lib to the
|
Trying to import module from CDN.
Originally posted by @f3l1x in #2358 (comment)
The question here is whether it should download that file or reference it (like in the source)
The text was updated successfully, but these errors were encountered: