Skip to content

Commit e755a1f

Browse files
authored
tidying up a tad
1 parent a1f56e8 commit e755a1f

File tree

1 file changed

+14
-9
lines changed

1 file changed

+14
-9
lines changed

README.md

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ instance.expensive(1000).then( count => {
4646

4747
### Options
4848

49+
Workerize options can either be defined in your Webpack configuration, or using Webpack's [syntax for inline loader options](https://webpack.js.org/concepts/loaders/#inline).
50+
4951
#### `inline`
5052

5153
Type: `Boolean`
@@ -60,7 +62,9 @@ You can also inline the worker as a BLOB with the `inline` parameter
6062
options: { inline: true }
6163
}
6264
```
63-
or
65+
66+
or
67+
6468
```js
6569
import worker from 'workerize-loader?inline!./worker'
6670
```
@@ -79,9 +83,11 @@ Customize filename generation for worker bundles. Note that a `.worker` suffix w
7983
options: { name: '[name].[contenthash:8]' }
8084
}
8185
```
82-
or
86+
87+
or
88+
8389
```js
84-
import worker from 'workerize-loader?{"name":"[name].[contenthash:8]"}!./worker'
90+
import worker from 'workerize-loader?name=[name].[contenthash:8]!./worker'
8591
```
8692

8793
#### `publicPath`
@@ -98,10 +104,6 @@ Workerize uses the configured value of `output.publicPath` from Webpack unless s
98104
options: { publicPath: '/static/' }
99105
}
100106
```
101-
or
102-
```js
103-
import worker from 'workerize-loader?{"publicPath":"/static/"}!./worker'
104-
```
105107

106108
#### `ready`
107109

@@ -117,12 +119,13 @@ If `true`, the imported "workerized" module will include a `ready` property, whi
117119
options: { ready: true }
118120
}
119121
```
120-
or
122+
123+
or
124+
121125
```js
122126
import worker from 'workerize-loader?ready!./worker'
123127

124128
let instance = worker() // `new` is optional
125-
126129
await instance.ready
127130
```
128131

@@ -140,7 +143,9 @@ When enabled, generated output will create your Workers using a Data URL that lo
140143
options: { import: true }
141144
}
142145
```
146+
143147
or
148+
144149
```js
145150
import worker from 'workerize-loader?import!./worker'
146151
```

0 commit comments

Comments
 (0)