diff --git a/lib/build/index.js b/lib/build/index.js index 45725f99eb..820f276a10 100644 --- a/lib/build/index.js +++ b/lib/build/index.js @@ -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) => {