Launches web workers that can use require() in the browser with webpack. Version 1.1.9 is the latest stable release, with no active development. It works by bundling a separate entry point for the worker, allowing Node.js-style module loading inside workers. Compared to alternatives like worker-loader or native worker blob URLs, this library provides a simpler API that mimics the original webworkify but is compatible with webpack's bundling. It is primarily used in webpack-based projects that need inline workers without separate files.
npm install webworkify-webpack-dropinVerified import paths — ran on the pinned version, not inferred.
Demonstrates creating a web worker from a module that uses require() inside the worker, with messaging and a dependency (gamma).
Set devtool to a non-eval option like 'source-map' or 'cheap-module-source-map'.
Use named functions in module.exports: module.exports = function worker(self) { ... }.Use work(require('./worker.js')) instead of work('./worker.js').Ensure the main script uses require('./worker.js') inside work().No dependency data recorded yet.