diff --git a/src/content/guides/web-workers.mdx b/src/content/guides/web-workers.mdx index 71843a79ac40..f6a7e64dc164 100644 --- a/src/content/guides/web-workers.mdx +++ b/src/content/guides/web-workers.mdx @@ -15,6 +15,8 @@ new Worker(new URL('./worker.js', import.meta.url)); The syntax was chosen to allow running code without bundler, it is also available in native ECMAScript modules in the browser. +Note that while the [`Worker` API](https://developer.mozilla.org/en-US/docs/Web/API/Worker/Worker) suggests that `Worker` constructor would accept a string representing the URL of the script, in webpack 5 you can only use `URL` instead. + ## Example **src/index.js**