Skip to content

Commit

Permalink
fix variable assignment error
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
maxboeck committed Dec 31, 2020
1 parent 7178476 commit 814e680
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 814e680

Please sign in to comment.