webpack-loader-worker
TypeScript icon, indicating that this package has built-in type declarations

0.0.7 • Public • Published

Package version Node engine version

webpack-loader-worker

webpack-loader-worker runs the following loaders in node.js worker_threads pool. It works as similar to thread-loader, but only supports native node.js worker threads. (node.js >= 12. Version below 12 are untested)

Install

npm install --save-dev webpack-loader-worker

Usage

Put this loader in front of other loaders. The following loaders run in a worker pool. Loaders running in a thread pool are limited, does not have full access to webpack loader's context.

Configuration examples

use[
  {
    loader: "webpack-loader-worker",
    options: {
      // the number of spawned workers, defaults to (number of cpus - 1)
      maxWorkers: 2,
      logLevel: 'info' | 'verbose'
    }
  },
  // your expensive loader (e.g babel-loader)
]

Credits

While this module is NOT officially affiliated, it relies on a lot of prior art from thread-loader. You may notice some similar logic, and it is expected.

Package Sidebar

Install

npm i webpack-loader-worker

Weekly Downloads

1

Version

0.0.7

License

MIT

Unpacked Size

74.5 kB

Total Files

53

Last publish

Collaborators

  • kwonoj