Skip to content

Commit 111e17a

Browse files
authored
Add Promise polyfill instructions
This was the last fix necessary for #95.
1 parent 3f74603 commit 111e17a

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

README.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,24 @@ If you're using [Babel](https://babeljs.io/) in your build, make sure you disabl
8585
}
8686
```
8787

88+
### Polyfill Required for IE11
89+
90+
Workerize-loader supports browsers that support Web Workers - that's IE10+.
91+
However, these browsers require a polyfill in order to use Promises, which Workerize-loader relies on.
92+
It is recommended that the polyfill be installed globally, since Webpack itself also needs Promises to load bundles.
93+
94+
The smallest implementation is the one we recommend installing:
95+
96+
`npm i promise-polyfill`
97+
98+
Then, in the module you are "workerizing", just add it as your first import:
99+
100+
```js
101+
import 'promise-polyfill/src/polyfill';
102+
```
103+
104+
All worker code can now use Promises.
105+
88106
### Testing
89107

90108
To test a module that is normally imported via `workerize-loader` when not using Webpack, import the module directly in your test:

0 commit comments

Comments
 (0)