From 4050292585f73a379e5e4c8d0ddbec603c95b762 Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Mon, 1 Jul 2019 15:46:34 +0100 Subject: [PATCH] Strip newlines from output HTML --- index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.ts b/index.ts index 9d4202c..adbef95 100644 --- a/index.ts +++ b/index.ts @@ -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 { 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) {