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

Handle import.meta.url #67

Open
developit opened this issue Apr 17, 2020 · 0 comments
Open

Handle import.meta.url #67

developit opened this issue Apr 17, 2020 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@developit
Copy link
Collaborator

It should be possible to apply a pre/pitching loader to all files that transforms import.meta.url to __filename. This would allow correct Worker URL creation (solving #31) using URL:

const url = new URL('./my-worker.js', import.meta.url);
const worker = new Worker(url, { type: 'module' });

I believe Webpack's simple partial evaluation should be enough to consider this a "static" URL under the current logic.

@developit developit self-assigned this Apr 17, 2020
@developit developit added the enhancement New feature or request label Apr 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant