From 67aa1391c12013aae70e08f5bbabb94e74b10a6d Mon Sep 17 00:00:00 2001 From: Alexander Akait <4567934+alexander-akait@users.noreply.github.com> Date: Wed, 26 May 2021 18:02:57 +0300 Subject: [PATCH] fix: crash in custom importers with worker threads (#958) --- 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); } ); }