fix(core): update
This commit is contained in:
@ -6,11 +6,10 @@ import * as plugins from './webrequest.plugins';
|
||||
export class WebRequest {
|
||||
private static polyfillsLoaded = false;
|
||||
public static loadNeededPolyfills() {
|
||||
if (!this.polyfillsLoaded) {
|
||||
const smartenv = new plugins.smartenv.Smartenv();
|
||||
if (!smartenv.isBrowser && !this.polyfillsLoaded) {
|
||||
this.polyfillsLoaded = true;
|
||||
// tslint:disable-next-line: no-eval
|
||||
const loadFetchPolyfill = eval(`globalThis.fetch = require('node-fetch')`);
|
||||
loadFetchPolyfill();
|
||||
globalThis.fetch = smartenv.getSafeNodeModule('node-fetch');
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,3 +1,4 @@
|
||||
import * as smartdelay from '@pushrocks/smartdelay';
|
||||
import * as smartenv from '@pushrocks/smartenv';
|
||||
|
||||
export { smartdelay };
|
||||
export { smartdelay, smartenv };
|
||||
|
Reference in New Issue
Block a user