Socket
Socket
Sign inDemoInstall

threads-plugin

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

threads-plugin - npm Package Compare versions

Comparing version 1.3.0 to 1.3.1

2

package.json
{
"name": "threads-plugin",
"version": "1.3.0",
"version": "1.3.1",
"description": "Webpack plugin to bundle threads.js workers automagically.",

@@ -5,0 +5,0 @@ "main": "dist/threads-plugin.js",

@@ -103,2 +103,7 @@ <p align="center">

## Electron
To use standard Node packages in Electron web workers, make sure Node integration in workers is [turned on](https://www.electronjs.org/docs/tutorial/multithreading)
and the plugin option [target](#target) is set to `electron-node-worker`.
## Options

@@ -157,4 +162,21 @@

### `target`
Due to the way webpack works, it may be necessary to change the target environment of the workers.
Possible values:
- `electron-node-worker` use this if you are using Electron and compiling web workers that have node integration enabled. See [Electron Multithreading](https://www.electronjs.org/docs/tutorial/multithreading).
Default value: `undefined`
Example with electron node workers:
```js
new ThreadsPlugin({
target: 'electron-node-worker'
})
```
## License
Apache-2.0

@@ -21,2 +21,3 @@ /**

import FetchCompileWasmTemplatePlugin from 'webpack/lib/web/FetchCompileWasmTemplatePlugin';
import NodeTargetPlugin from 'webpack/lib/node/NodeTargetPlugin';
import WORKER_PLUGIN_SYMBOL from './symbol';

@@ -61,2 +62,5 @@

workerCompiler.context = this._compiler.context;
if (pluginOptions.target === "electron-node-worker") {
new NodeTargetPlugin().apply(workerCompiler);
}
(new WebWorkerTemplatePlugin(workerOptions)).apply(workerCompiler);

@@ -63,0 +67,0 @@ (new FetchCompileWasmTemplatePlugin({

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

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