New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

rollup-plugin-worker

Package Overview
Dependencies
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rollup-plugin-worker

a rollup plugin for worker

latest
Source
npmnpm
Version
3.0.4
Version published
Maintainers
1
Created
Source

rollup-plugin-worker

a rollup plugin for worker

Usage

Create a rollup.config.js and import the plugin:

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

module.exports = {
    plugins: [
        worker({
            prefix: 'worker!',
            plugins: [],
            uglify: false,
        }),
    ],
};

Options

  • prefix: string; default is 'worker!'
  • plugins: Plugin[]; Plugins needed in the process of processing worker
  • uglify: boolean; default is false; enable uglify?

Source Code

import Worker from 'worker!./workers/worker.js';

const worker = new Worker();

Use in typescript

Create a typing.d.ts in project and declare a module:

declare module 'worker!*' {
  class WebWorker extends Worker {
    constructor();
  }

  export default WebWorker;
}

Keywords

rollup-plugin-worker

FAQs

Package last updated on 23 Nov 2022

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