From a972358900ecf15cac7c54c3819ee5cf7429c55d Mon Sep 17 00:00:00 2001 From: H M SHAHADUL ISLAM Date: Tue, 30 Jan 2024 11:04:20 +0600 Subject: [PATCH] fixed TypeError: Cannot read properties of undefined (reading 'apply') --- src/index.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/index.js b/src/index.js index d65b335..942d786 100644 --- a/src/index.js +++ b/src/index.js @@ -103,8 +103,12 @@ class WebpackRTLPlugin { } }) - cssnanoPromise.then(() => { - chunk.files.push.apply(chunk.files, rtlFiles) + cssnanoPromise.then(() => { + if (chunk.files instanceof Set) { + rtlFiles.forEach( item => chunk.files.add( item ) ); + } else { + chunk.files.push.apply(chunk.files, rtlFiles) + } cb() }) }, callback)