-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
deno bundle doesn't work with import.meta #2553
Comments
Yeah, I am not sure of an easy way around that, because any bundle is not going to be an ESM module. We could "ignore" the TypeScript error when doing the bundle, but then would a bundled version have the right behaviours. Hmmm... 🤔 |
What is the expected behavior for this? Should we replace ({ url: "file:///path/to/file.js", main: false }) |
Hmmm... Possibly... Just checking with recent versions of TypeScript and |
So this: declare function runIfMain(arg: any): void;
runIfMain(import.meta); Emits as this for System, which I already have a branch where I am trying to move bundling to System and supply the context, so just need to supply the right value: System.register([], function (exports_1, context_1) {
"use strict";
var __moduleName = context_1 && context_1.id;
return {
setters: [],
execute: function () {
runIfMain(context_1.meta);
}
};
}); |
Moves to using a minimal System loader for bundles generated by Deno. TypeScript in 3.8 will be able to output TLA for modules, and the loader is written to take advantage of that as soon as we update Deno to TS 3.8. System also allows us to support `import.meta` and provide more ESM aligned assignment of exports, as well as there is better handling of circular imports. The loader is also very terse versus to try to save overhead. Also, fixed an issue where abstract classes were not being rexported. Fixes denoland#2553 Fixes denoland#3559 Fixes denoland#3751 Fixes denoland#3825 Refs denoland#3301
Moves to using a minimal System loader for bundles generated by Deno. TypeScript in 3.8 will be able to output TLA for modules, and the loader is written to take advantage of that as soon as we update Deno to TS 3.8. System also allows us to support `import.meta` and provide more ESM aligned assignment of exports, as well as there is better handling of circular imports. The loader is also very terse versus to try to save overhead. Also, fixed an issue where abstract classes were not being rexported. Fixes denoland#2553 Fixes denoland#3559 Fixes denoland#3751 Fixes denoland#3825 Refs denoland#3301
Moves to using a minimal System loader for bundles generated by Deno. TypeScript in 3.8 will be able to output TLA for modules, and the loader is written to take advantage of that as soon as we update Deno to TS 3.8. System also allows us to support `import.meta` and provide more ESM aligned assignment of exports, as well as there is better handling of circular imports. The loader is also very terse versus to try to save overhead. Also, fixed an issue where abstract classes were not being re-exported. Fixes #2553 Fixes #3559 Fixes #3751 Fixes #3825 Refs #3301
The text was updated successfully, but these errors were encountered: