Skip to content

Commit

Permalink
Trim starting file whitespace for consistent output
Browse files Browse the repository at this point in the history
  • Loading branch information
dpilafian committed Jul 12, 2023
1 parent 318f393 commit 2a2272d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion replacer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,8 @@ const replacer = {
const out3 = settings.find ? out2.replaceAll(settings.find, newStr) : out2;
const out4 = settings.regex ? out3.replace(settings.regex, newStr) : out3;
const out5 = settings.noSourceMap ? out4.replace(sourceMapLine, '') : out4;
const final = append && settings.header ? '\n' + out5 : out5;
const out6 = out5.trimStart();
const final = append && settings.header ? '\n' + out6 : out6;
fs.mkdirSync(path.dirname(file.dest), { recursive: true });
return append ? fs.appendFileSync(file.dest, final) : fs.writeFileSync(file.dest, final);
};
Expand Down

0 comments on commit 2a2272d

Please sign in to comment.