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({