Skip to content

Commit

Permalink
Inline webpack hack
Browse files Browse the repository at this point in the history
  • Loading branch information
aminya committed Apr 30, 2021
1 parent 9d4cba9 commit 4356e43
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/master/implementation.node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,12 @@ import {
ThreadsWorkerOptions,
WorkerImplementation
} from "../types/master"
import { isWebpack, requireFunction } from "../webpack-hack"
export declare const __non_webpack_require__: typeof require

// TODO remove webpack hacks. These hurt the performance for non-web-pack situations
// Webpack hack
declare const __non_webpack_require__: typeof require
const isWebpack = typeof __non_webpack_require__ === "function"
const requireFunction: typeof require = isWebpack ? __non_webpack_require__ : eval("require")

interface WorkerGlobalScope {
addEventListener(eventName: string, listener: (event: Event) => void): void
Expand Down

0 comments on commit 4356e43

Please sign in to comment.