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

Document magic comments in new Worker constructors #6535

Closed
benjamind opened this issue Dec 5, 2022 · 1 comment · Fixed by #6536
Closed

Document magic comments in new Worker constructors #6535

benjamind opened this issue Dec 5, 2022 · 1 comment · Fixed by #6536

Comments

@benjamind
Copy link

Bug report

Current documentation for magic comments does not mention their use within new Worker constructors (but they do work there!).

What is the current behavior?
Missing documentation.

https://webpack.js.org/api/module-methods/#magic-comments

If the current behavior is a bug, please provide the steps to reproduce.

What is the expected behavior?

Expect to see documentation on the use of magic comments within worker constructors :

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

This functionality does appear to work today it's just not documented. This was discovered when filing this issue on Esbuild to support these comments: evanw/esbuild#2439 (comment)

Other relevant information:
webpack version:
Node.js version:
Operating System:
Additional tools:

@alexander-akait alexander-akait transferred this issue from webpack/webpack Dec 5, 2022
@alexander-akait
Copy link
Member

Thank you for the issue

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

Successfully merging a pull request may close this issue.

2 participants