From af7c6ef5cdb8763048d6e17e7b25f94ce894b949 Mon Sep 17 00:00:00 2001 From: Ramiro Silveyra d'Avila Date: Wed, 23 Dec 2020 09:57:08 -0300 Subject: [PATCH] fix: serializing big strings (#304) --- src/supportWebpack5.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/supportWebpack5.js b/src/supportWebpack5.js index a2a9f61..311acb1 100644 --- a/src/supportWebpack5.js +++ b/src/supportWebpack5.js @@ -60,17 +60,18 @@ export default function runAsChild( workerSource, options ); + const workerCodeBuffer = Buffer.from(workerCode); return cache.store( cacheIdent, cacheETag, - workerCode, + workerCodeBuffer, (storeCacheError) => { if (storeCacheError) { return callback(storeCacheError); } - return callback(null, workerCode); + return callback(null, workerCodeBuffer); } ); });