From 7aeae05144d2bdef1098e52c43f479973a019139 Mon Sep 17 00:00:00 2001 From: evilebottnawi Date: Wed, 26 May 2021 17:52:29 +0300 Subject: [PATCH] fix: crash in custom importers with worker threads --- src/utils.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/utils.js b/src/utils.js index bd5c2284..395777d5 100644 --- a/src/utils.js +++ b/src/utils.js @@ -81,9 +81,9 @@ function proxyCustomImporters(importers, loaderContext) { return [].concat(importers).map( (importer) => function proxyImporter(...args) { - this.webpackLoaderContext = loaderContext; + const self = { ...this, webpackLoaderContext: loaderContext }; - return importer.apply(this, args); + return importer.apply(self, args); } ); }