From 65754d34bc1debd3e5165990795c9e891891c456 Mon Sep 17 00:00:00 2001 From: Phil Kunz Date: Wed, 17 Jul 2019 11:54:49 +0200 Subject: [PATCH] fix(core): update --- ts/tsbundle.htmlhandler.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/ts/tsbundle.htmlhandler.ts b/ts/tsbundle.htmlhandler.ts index 3a3300a..41b5a19 100644 --- a/ts/tsbundle.htmlhandler.ts +++ b/ts/tsbundle.htmlhandler.ts @@ -5,8 +5,15 @@ export class HtmlHandler { public sourceFilePath: string = plugins.path.join(paths.htmlDir, 'index.html'); public targetFilePath: string = plugins.path.join(paths.distWebDir, 'index.html'); + public async checkIfExists () { + return plugins.smartfile.fs.fileExists(this.sourceFilePath); + } + // copies the html public async copyHtml() { + if (!(await this.checkIfExists)) { + return; + } await plugins.smartfile.fs.copy( this.sourceFilePath, this.targetFilePath @@ -15,6 +22,9 @@ export class HtmlHandler { // copies and minifies the html public async minifyHtml() { + if (!(await this.checkIfExists)) { + return; + } const fileString = plugins.smartfile.fs.toStringSync(this.sourceFilePath); const minifiedHtml = plugins.htmlMinifier.minify(fileString, { minifyCSS: true,