Skip to content

Commit 4badee1

Browse files
author
Ludwig Meysel
committed
Add require/exports to worker scope
1 parent aaf2874 commit 4badee1

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/index.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ if (!objects) {
2727
objects[id] = blob;
2828
return `blob:http://localhost/${id}`;
2929
};
30-
self.URL.revokeObjectURL = (url) => {
30+
self.URL.revokeObjectURL = url => {
3131
let m = String(url).match(/^blob:http:\/\/localhost\/(.+)$/);
3232
if (m) delete objects[m[1]];
3333
};
@@ -97,6 +97,8 @@ function Worker(url, options) {
9797
},
9898
fetch: self.fetch,
9999
importScripts() {},
100+
require,
101+
exports,
100102
};
101103
inside.on('message', e => {
102104
if (terminated) return;

0 commit comments

Comments
 (0)