Skip to content

Commit e604104

Browse files
authored
docs(guides): mention limitation of Worker api (webpack#6436)
1 parent d6a42c5 commit e604104

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/content/guides/web-workers.mdx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ new Worker(new URL('./worker.js', import.meta.url));
1515
1616
The syntax was chosen to allow running code without bundler, it is also available in native ECMAScript modules in the browser.
1717
18+
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.
19+
1820
## Example
1921
2022
**src/index.js**

0 commit comments

Comments
 (0)