add layouts folder for extends app

This commit is contained in:
Alexandre Chopin 2016-12-07 13:30:25 +01:00
parent 3536936856
commit 57997e294e

View File

@ -202,9 +202,15 @@ function * generateRoutesAndFiles () {
if (files.includes('pages/_app.vue')) {
templateVars.appPath = r(this.dir, 'pages/_app.vue')
}
if (fs.existsSync(join(this.dir, 'layouts', 'app.vue'))) {
templateVars.appPath = r(this.dir, 'layouts/app.vue')
}
if (files.includes('pages/_error.vue')) {
templateVars.components.ErrorPage = r(this.dir, 'pages/_error.vue')
}
if (fs.existsSync(join(this.dir, 'layouts', 'error.vue'))) {
templateVars.appPath = r(this.dir, 'layouts/error.vue')
}
let moveTemplates = templatesFiles.map((file) => {
return readFile(r(__dirname, '..', 'app', file), 'utf8')
.then((fileContent) => {