From 26093fdf3cae8508f5f8e4df92ab478c96717c19 Mon Sep 17 00:00:00 2001 From: EryouHao Date: Wed, 1 Jan 2020 22:32:36 +0800 Subject: [PATCH] fix: fix copy favicon bug --- src/server/renderer.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/server/renderer.ts b/src/server/renderer.ts index 0644fe70..ba0cfc18 100644 --- a/src/server/renderer.ts +++ b/src/server/renderer.ts @@ -612,7 +612,10 @@ export default class Renderer extends Model { fse.copySync(urlJoin(this.appDir, 'static'), this.outputDir) // Copy favicon.ico - fse.copyFileSync(urlJoin(this.appDir, 'favicon.ico'), urlJoin(this.outputDir, 'favicon.ico')) + const faviconInputPath = urlJoin(this.appDir, 'favicon.ico') + if (fse.existsSync(faviconInputPath)) { + fse.copyFileSync(faviconInputPath, urlJoin(this.outputDir, 'favicon.ico')) + } } async clearOutputFolder() {