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

Webpack "magic comments" do not work in Worker constructors #267

Closed
1 task
benjamind opened this issue Aug 3, 2022 · 1 comment
Closed
1 task

Webpack "magic comments" do not work in Worker constructors #267

benjamind opened this issue Aug 3, 2022 · 1 comment
Labels
bug Something isn't working pending triage

Comments

@benjamind
Copy link

Bug description

Worker constructors don't work with magic comments so chunks cannot be easily named.

new Worker(
        /* webpackChunkName: "foo-worker" */ new URL(
            "../foo-worker.ts",
            import.meta.url
        ),
        { type: "module" }
    );

Filed a separate ticket on esbuild project where this needs to be fixed: evanw/esbuild#2439

Reproduction

Use the following syntax to load a worker with a webpack chunk name magic comment:

new Worker(
        /* webpackChunkName: "foo-worker" */ new URL(
            "../foo-worker.ts",
            import.meta.url
        ),
        { type: "module" }
    );

Note that the worker chunk does not have the name correctly applied.

Node.js package manager

npm

Environment

Any

Can you contribute a fix?

  • I’m interested in opening a pull request for this issue.
@benjamind benjamind added bug Something isn't working pending triage labels Aug 3, 2022
@privatenumber
Copy link
Owner

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working pending triage
Projects
None yet
Development

No branches or pull requests

2 participants