Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

worker-plugin

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

worker-plugin

Webpack plugin to bundle Workers automagically.

  • 5.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
201K
increased by0.95%
Maintainers
1
Weekly downloads
 
Created

What is worker-plugin?

The worker-plugin npm package is a Webpack plugin that allows you to use Web Workers with Webpack seamlessly. It simplifies the process of bundling and using Web Workers in your application by handling the necessary configurations and dependencies.

What are worker-plugin's main functionalities?

Automatic Web Worker bundling

This feature allows you to automatically bundle Web Workers with your Webpack configuration. By adding the WorkerPlugin to your Webpack plugins array, you can seamlessly use Web Workers in your application without additional configuration.

const WorkerPlugin = require('worker-plugin');

module.exports = {
  // Other Webpack configuration options...
  plugins: [
    new WorkerPlugin()
  ]
};

Inline Web Worker support

This feature allows you to create Web Workers inline using the new URL syntax. The WorkerPlugin handles the necessary bundling and ensures that the Web Worker is correctly loaded and executed.

const worker = new Worker(new URL('./worker.js', import.meta.url));
worker.postMessage('Hello, worker!');

TypeScript support

The WorkerPlugin also supports TypeScript, allowing you to create and use Web Workers written in TypeScript. This feature ensures that your TypeScript Web Workers are correctly transpiled and bundled.

const worker = new Worker(new URL('./worker.ts', import.meta.url));
worker.postMessage('Hello, TypeScript worker!');

Other packages similar to worker-plugin

Keywords

FAQs

Package last updated on 27 May 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc