-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[WEBPACK] Avoid warning on certain webpack builds. Fixes #19
- Loading branch information
Showing
1 changed file
with
7 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,11 @@ | ||
var kRequire = | ||
typeof module !== 'undefined' && typeof module.require === 'function' && module.require || // eslint-disable-line | ||
typeof __non_webpack_require__ === 'function' && __non_webpack_require__ || // eslint-disable-line | ||
typeof require === 'function' && require || // eslint-disable-line | ||
null; // eslint-disable-line | ||
|
||
var WorkerClass = null; | ||
|
||
if (kRequire) { | ||
try { WorkerClass = kRequire('worker_threads').Worker; } catch(e) {} // eslint-disable-line | ||
} | ||
try { | ||
var WorkerThreads = | ||
typeof module !== 'undefined' && typeof module.require === 'function' && module.require('worker_threads') || | ||
typeof __non_webpack_require__ === 'function' && __non_webpack_require__('worker_threads') || | ||
typeof require === 'function' && require('worker_threads'); | ||
WorkerClass = WorkerThreads.Worker; | ||
} catch(e) {} // eslint-disable-line | ||
|
||
export {WorkerClass}; |