Skip to content

Commit 15d0cd8

Browse files
committed
add convenience/help proxy for workerize-loader
1 parent a893c30 commit 15d0cd8

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

loader.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
try {
2+
module.exports = require('workerize-loader');
3+
}
4+
catch (e) {
5+
console.warn("Warning: workerize-loader is not installed.");
6+
module.exports = function() {
7+
throw "To use workerize as a loader, you must install workerize-loader.";
8+
}
9+
}

package.json

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,21 @@
33
"version": "0.1.2",
44
"description": "Run a module in a Web Worker.",
55
"main": "dist/workerize.js",
6-
"module": "src/index.js",
6+
"module": "dist/workerize.m.js",
7+
"source": "src/index.js",
78
"repository": "developit/workerize",
9+
"loader": "./loader.js",
810
"scripts": {
911
"build": "microbundle",
1012
"prepublishOnly": "npm run build",
1113
"release": "npm t && git commit -am $npm_package_version && git tag $npm_package_version && git push && git push --tags && npm publish",
1214
"test": "echo \"Error: no test specified\" && exit 0"
1315
},
16+
"files": [
17+
"src",
18+
"dist",
19+
"loader.js"
20+
],
1421
"keywords": [
1522
"worker",
1623
"web workers",

0 commit comments

Comments
 (0)