Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bergos/require-worker
A small AMD compatible module loader for Web Workers
https://github.com/bergos/require-worker
Last synced: about 2 months ago
JSON representation
A small AMD compatible module loader for Web Workers
- Host: GitHub
- URL: https://github.com/bergos/require-worker
- Owner: bergos
- Created: 2013-06-06T18:11:57.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2013-06-06T18:17:31.000Z (over 11 years ago)
- Last Synced: 2024-04-14T18:21:39.109Z (10 months ago)
- Language: JavaScript
- Size: 105 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# require-worker
`require-worker` is a small AMD compatible module loader for Web Workers.
## Usage
Import `require-worker` using importScripts in your worker. The script provides the `requireworker` function to load AMD modules synchronous. Here is an example:
importScripts('require-worker');
var module1 = requireworker('module1');### r.js Optimizer
`jake-requirejs` provides a function to optimize your worker script.
jakeRequireJs.optimizeWorker('worker.build.js', {});
To import `require-worker.js` as the first file of your optimized output you need to define it as a wrapper in your build file.
wrap: { startFile: "require-worker.js" }
### License
Licensed under the Apache License, Version 2.0
()