File tree Expand file tree Collapse file tree 2 files changed +8
-5
lines changed Expand file tree Collapse file tree 2 files changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -10,18 +10,14 @@ import {
1010 ThreadsWorkerOptions ,
1111 WorkerImplementation
1212} from "../types/master"
13+ import { isWebpack , requireFunction , __non_webpack_require__ } from '../webpack-hack'
1314
1415interface WorkerGlobalScope {
1516 addEventListener ( eventName : string , listener : ( event : Event ) => void ) : void
1617 postMessage ( message : any , transferables ?: any [ ] ) : void
1718 removeEventListener ( eventName : string , listener : ( event : Event ) => void ) : void
1819}
1920
20- // TODO remove webpack hacks. These hurt the performance for non-web-pack situations
21- // Webpack hack
22- declare let __non_webpack_require__ : typeof require
23- const isWebpack = typeof __non_webpack_require__ === "function"
24- const requireFunction : typeof require = isWebpack ? __non_webpack_require__ : eval ( "require" )
2521
2622declare const self : WorkerGlobalScope
2723
Original file line number Diff line number Diff line change 1+ // tslint:disable no-eval
2+
3+ // TODO remove webpack hacks. These hurt the performance for non-web-pack situations
4+ // Webpack hack
5+ export declare let __non_webpack_require__ : typeof require
6+ export const isWebpack = typeof __non_webpack_require__ === "function"
7+ export const requireFunction : typeof require = isWebpack ? __non_webpack_require__ : eval ( "require" )
You can’t perform that action at this time.
0 commit comments