📦 pixijs / webworker-plugins

2 stars 0 forks 👁 2 watching ⚖️ MIT License
📥 Clone https://github.com/pixijs/webworker-plugins.git
HTTPS git clone https://github.com/pixijs/webworker-plugins.git
SSH git clone git@github.com:pixijs/webworker-plugins.git
CLI gh repo clone pixijs/webworker-plugins
Zyie Zyie 1.0.1 b6fa924 1 months ago 📝 History
📁 .github
📁 .vscode
📁 src
📁 test
📄 .gitignore
📄 .npmrc
📄 LICENSE
📄 README.md
📄 README.md

@pixi/webworker-plugins

![npm version](https://www.npmjs.com/package/@pixi/webworker-plugins)

Plugins for Web Workers.

import FooWorker from 'worker:./foo.worker.ts';

Install

npm install @pixi/webworker-plugins --save-dev

@pixi/webworker-plugins/jest-transform

Jest transform for Web Workers.

Usage

Add the following code to your jest.config.js:

module.exports = {
    transform: {
        '\\.worker.ts$': '@pixi/webworker-plugins/lib/jest-transform',
    },
    moduleNameMapper: {
        '^worker:(.*)$': '$1',
    },
    // ...
};

@pixi/webworker-plugins/rollup-plugin

Rollup plugin for Web Workers.

Usage

Add the following code to your rollup.config.mjs:

import webworker from '@pixi/webworker-plugins/rollup-plugin';

export default { plugins: [ webworker(), ], // ... };