From 0e2474c681a480d40cbad6cbadb151786ec0a680 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Chopin?= Date: Wed, 22 Feb 2017 18:19:49 +0000 Subject: [PATCH] Check if app.html exists --- lib/nuxt.js | 5 +++++ lib/webpack/client.config.js | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/nuxt.js b/lib/nuxt.js index a049290ee9..660cbc48c5 100644 --- a/lib/nuxt.js +++ b/lib/nuxt.js @@ -65,6 +65,11 @@ class Nuxt { if (fs.existsSync(join(this.srcDir, 'middleware'))) { this.options.middleware = true } + // If app.html is defined, set the template path to the user template + this.options.appTemplatePath = resolve(__dirname, 'views/app.template.html') + if (fs.existsSync(join(this.srcDir, 'app.html'))) { + this.options.appTemplatePath = join(this.srcDir, 'app.html') + } // renderer used by Vue.js (via createBundleRenderer) this.renderer = null // For serving static/ files to / diff --git a/lib/webpack/client.config.js b/lib/webpack/client.config.js index dffff99230..5df452bc07 100644 --- a/lib/webpack/client.config.js +++ b/lib/webpack/client.config.js @@ -56,7 +56,7 @@ export default function () { }), // Generate output HTML new HTMLPlugin({ - template: resolve(__dirname, 'views/app.template.html') + template: this.options.appTemplatePath }), // Add defer to scripts new ScriptExtHtmlWebpackPlugin({