File tree Expand file tree Collapse file tree 1 file changed +6
-22
lines changed Expand file tree Collapse file tree 1 file changed +6
-22
lines changed Original file line number Diff line number Diff line change 1- // Webpack hack
2- // tslint:disable no-eval
3-
4- declare function __non_webpack_require__ ( module : string ) : any
5-
6- // FIXME
7- type MessagePort = any
8-
9- interface WorkerThreadsModule {
10- MessagePort : typeof MessagePort
11- isMainThread : boolean
12- parentPort : MessagePort
13- }
14-
15- let implementation : WorkerThreadsModule | undefined
1+ // TODO this file isn't used!
162
17- function selectImplementation ( ) : WorkerThreadsModule {
18- return typeof __non_webpack_require__ === "function"
19- ? __non_webpack_require__ ( "worker_threads" )
20- : eval ( "require" ) ( "worker_threads" )
21- }
3+ // Webpack hack
4+ import { requireFunction } from './webpack-hack'
225
23- export default function getImplementation ( ) : WorkerThreadsModule {
6+ let implementation : typeof import ( "worker_threads" ) | undefined
7+ export default function getImplementation ( ) {
248 if ( ! implementation ) {
25- implementation = selectImplementation ( )
9+ implementation = ( requireFunction ( "worker_threads" ) as typeof import ( "worker_threads" ) )
2610 }
2711 return implementation
2812}
You can’t perform that action at this time.
0 commit comments