threads-plugin
Advanced tools
Comparing version 1.2.0 to 1.3.0-beta
@@ -32,4 +32,5 @@ function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; } | ||
WorkerPlugin.prototype.apply = function apply (compiler) { | ||
var workerId = 0; | ||
compiler.hooks.normalModuleFactory.tap(NAME, function (factory) { | ||
var workerId = 0; | ||
for (var i = 0, list = JS_TYPES; i < list.length; i += 1) { | ||
@@ -88,3 +89,3 @@ var type = list[i]; | ||
compiler.hooks.afterCompile.tap(NAME, function (compilation) { | ||
if (workerId === 0) { | ||
{ | ||
compilation.warnings.push({ | ||
@@ -91,0 +92,0 @@ message: 'No instantiations of threads.js workers found.\n' + 'Please check that:\n' + ' 1. You have configured Babel / TypeScript to not transpile ES modules\n' + ' 2. You import `Worker` from `threads` where you use it\n\n' + 'For more details see: https://github.com/andywer/threads-plugin\n' |
{ | ||
"name": "threads-plugin", | ||
"version": "1.2.0", | ||
"version": "1.3.0-beta", | ||
"description": "Webpack plugin to bundle threads.js workers automagically.", | ||
@@ -78,2 +78,3 @@ "main": "dist/threads-plugin.js", | ||
"jest": "^24.8.0", | ||
"memory-fs": "^0.4.1", | ||
"microbundle": "^0.11.0", | ||
@@ -80,0 +81,0 @@ "puppeteer": "^1.11.0", |
@@ -36,2 +36,3 @@ /** | ||
compiler.hooks.normalModuleFactory.tap(NAME, factory => { | ||
let workerId = 0; | ||
for (const type of JS_TYPES) { | ||
@@ -38,0 +39,0 @@ factory.hooks.parser.for(`javascript/${type}`).tap(NAME, parser => { |
@@ -44,3 +44,3 @@ /** | ||
chunkFilename, | ||
globalObject: pluginOptions.globalObject || 'self' | ||
globalObject: pluginOptions.globalObject || `(typeof self !== 'undefined' ? self : this)` | ||
}; | ||
@@ -47,0 +47,0 @@ |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
342032
4077
18
2