Check if app.html exists

This commit is contained in:
Sébastien Chopin 2017-02-22 18:19:49 +00:00
parent 66c5aad09d
commit 0e2474c681
2 changed files with 6 additions and 1 deletions

View File

@ -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 /

View File

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