Skip to content

Commit 3294f39

Browse files
authored
Merge pull request #47 from fnlctrl/patch-1
Add documentation about `inline` option
2 parents 381d008 + 5c5219a commit 3294f39

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

README.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,27 @@ instance.expensive(1000).then( count => {
4444
})
4545
```
4646

47+
### Options
48+
49+
#### `inline`
50+
51+
Type: `Boolean`
52+
Default: `false`
53+
54+
You can also inline the worker as a BLOB with the `inline` parameter
55+
56+
```js
57+
// webpack.config.js
58+
{
59+
loader: 'workerize-loader',
60+
options: { inline: true }
61+
}
62+
```
63+
or
64+
```js
65+
import worker from 'workerize-loader?inline!./worker'
66+
```
67+
4768
### About [Babel](https://babeljs.io/)
4869

4970
If you're using [Babel](https://babeljs.io/) in your build, make sure you disabled commonJS transform. Otherwize, workerize-loader won't be able to retrieve the list of exported function from your worker script :

0 commit comments

Comments
 (0)