From 814e680764300b3082d4b40265682ed087eee315 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Max=20B=C3=B6ck?= Date: Thu, 31 Dec 2020 14:11:24 +0100 Subject: [PATCH] fix variable assignment error when running in "directory" mode, I'm seeing this error: `TemplateWriterWriteError` was thrown: Assignment to constant variable. this is caused by the re-assignment of `assets` on L110. Declaring it as a mutable variable seems to fix the issue. --- src/plugin.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugin.js b/src/plugin.js index 72875cc..fef469f 100644 --- a/src/plugin.js +++ b/src/plugin.js @@ -101,7 +101,7 @@ async function transformDirectoryWalker(content, outputPath) { const templateDir = path.dirname(template.inputPath); const outputDir = path.dirname(outputPath); - const assets = []; + let assets = []; if (pluginOptions.recursive) { for await (const file of walk(templateDir)) { assets.push(file);