archive
/
givemoneyto.me
Archived
1
Fork 0

Strip newlines from output HTML

This commit is contained in:
Jake Howard 2019-07-01 15:46:34 +01:00
parent 8660d4d160
commit 4050292585
Signed by: jake
GPG Key ID: 57AFB45680EDD477
1 changed files with 2 additions and 2 deletions

View File

@ -25,12 +25,12 @@ const PROGRESS_BAR_FORMAT = '[:bar] :rate/ps :percent :current/:total';
const MAX_VALUE = process.env.MAX_VALUE
? parseInt(process.env.MAX_VALUE, 10)
: 2;
const BUNDLER_OPTIONS = {
outDir: BUILD_DIR,
watch: false,
minify: true,
};
const NEW_LINES_RE = /(\r\n|\n|\r)/gm;
function readAccounts(): ReadonlyArray<Account> {
const rawAccounts: object = jsyaml.safeLoad(
@ -61,7 +61,7 @@ function writeTemplate(
) {
const outputFile = join(BUILD_DIR, value, 'index.html');
mkdirp.sync(dirname(outputFile));
writeFileSync(outputFile, template(context));
writeFileSync(outputFile, template(context).replace(NEW_LINES_RE, ''));
}
function writeRedirects(redirects: ReadonlyArray<Redirect>) {