mirror of
https://github.com/nuxt/nuxt.git
synced 2024-12-18 02:07:14 +00:00
Check if app.html exists
This commit is contained in:
parent
66c5aad09d
commit
0e2474c681
@ -65,6 +65,11 @@ class Nuxt {
|
|||||||
if (fs.existsSync(join(this.srcDir, 'middleware'))) {
|
if (fs.existsSync(join(this.srcDir, 'middleware'))) {
|
||||||
this.options.middleware = true
|
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)
|
// renderer used by Vue.js (via createBundleRenderer)
|
||||||
this.renderer = null
|
this.renderer = null
|
||||||
// For serving static/ files to /
|
// For serving static/ files to /
|
||||||
|
@ -56,7 +56,7 @@ export default function () {
|
|||||||
}),
|
}),
|
||||||
// Generate output HTML
|
// Generate output HTML
|
||||||
new HTMLPlugin({
|
new HTMLPlugin({
|
||||||
template: resolve(__dirname, 'views/app.template.html')
|
template: this.options.appTemplatePath
|
||||||
}),
|
}),
|
||||||
// Add defer to scripts
|
// Add defer to scripts
|
||||||
new ScriptExtHtmlWebpackPlugin({
|
new ScriptExtHtmlWebpackPlugin({
|
||||||
|
Loading…
Reference in New Issue
Block a user