mirror of
https://github.com/gpujs/gpu.js.git
synced 2026-01-25 16:08:02 +00:00
This allows downstream consumers to use GPU.js with requirejs,
d3-require, unpkg, jsdelivr, and probably some other systems. The main
changes:
- Set { standalone: 'UMD' } in browserify configuration. This makes it
publish a UMD build that exposes a 'UMD' export or global for
CommonJS, require, and AMD.
- Move bin/ to dist/, because these are properly distribution files
rather than binaries.
- Update tests to point to the dist/ version.
- Simplify browser.js to always export, because it is not the
recommended entry point for any browser.
- Add unpkg and jsdelivr fields to package.json so that those CDNs
automatically pick up on the right file when someone tries to include
from them.
8 lines
217 B
JavaScript
8 lines
217 B
JavaScript
const lib = require('./index');
|
|
const GPU = lib.GPU;
|
|
for (const p in lib) {
|
|
if (!lib.hasOwnProperty(p)) continue;
|
|
if (p === 'GPU') continue; //prevent recursive reference
|
|
GPU[p] = lib[p];
|
|
}
|
|
module.exports = GPU; |