Skip to content

Commit

Permalink
docs: update features.md note about ESM imports in web workers (#13223)
Browse files Browse the repository at this point in the history
  • Loading branch information
vincerubinetti authored May 17, 2023
1 parent 13fc345 commit 0cbd818
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/guide/features.md
Original file line number Diff line number Diff line change
Expand Up @@ -541,7 +541,7 @@ import MyWorker from './worker?worker'
const worker = new MyWorker()
```

The worker script can also use `import` statements instead of `importScripts()` - note during dev this relies on browser native support and currently only works in Chrome, but for the production build it is compiled away.
The worker script can also use ESM `import` statements instead of `importScripts()`. **Note**: During dev this relies on [browser native support](https://caniuse.com/?search=module%20worker) (currently not supported in Firefox), but for the production build it is compiled away.

By default, the worker script will be emitted as a separate chunk in the production build. If you wish to inline the worker as base64 strings, add the `inline` query:

Expand Down

0 comments on commit 0cbd818

Please sign in to comment.