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

Basing syntax on Import Assertions syntax #16

Open
AlicanC opened this issue Jan 2, 2021 · 0 comments
Open

Basing syntax on Import Assertions syntax #16

AlicanC opened this issue Jan 2, 2021 · 0 comments

Comments

@AlicanC
Copy link

AlicanC commented Jan 2, 2021

I think it would be great if the syntax was closer to what's being introduced in Import Assertions:

import logoModuleReference from "./logo.svg" as reference;
// OR
const logoModuleReference: ModuleReference = await import('./logo.svg', { as: 'reference' });

const logoUrl: string = URL.createObjectURL(logoModuleReference);

import workerModuleReference from "./worker.js" as reference;
const worker = new Worker(workerModuleReference);

Note: I've rewritten this post, because I've interpreted the goal of Import Assertions wrong.

@AlicanC AlicanC changed the title Basing this proposal on Import Assertions Basing syntax on Import Assertions syntax Jan 2, 2021
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

1 participant