From e3eb83d669992cfb9ec6e3a9aba2a1d12af0e311 Mon Sep 17 00:00:00 2001 From: Sebastien Chopin Date: Thu, 17 Aug 2017 15:13:56 +0200 Subject: [PATCH] Fix lint --- lib/builder/builder.js | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/lib/builder/builder.js b/lib/builder/builder.js index 4c54bca1a6..e6404ca7e8 100644 --- a/lib/builder/builder.js +++ b/lib/builder/builder.js @@ -89,7 +89,7 @@ export default class Builder extends Tapable { }) } - forGenerate() { + forGenerate () { this.isStatic = true } @@ -195,10 +195,10 @@ export default class Builder extends Tapable { // -- Layouts -- if (fs.existsSync(resolve(this.options.srcDir, 'layouts'))) { - const layoutsFiles = await glob('layouts/*.{vue,js}', { cwd: this.options.srcDir }) + const layoutsFiles = await glob('layouts/*.vue', { cwd: this.options.srcDir }) let hasErrorLayout = false layoutsFiles.forEach((file) => { - let name = file.split('/').slice(-1)[0].replace(/\.(js|vue)$/, '') + let name = file.split('/').slice(-1)[0].replace(/\.vue$/, '') if (name === 'error') { hasErrorLayout = true return @@ -206,7 +206,7 @@ export default class Builder extends Tapable { templateVars.layouts[name] = this.relativeToBuild(this.options.srcDir, file) }) if (!templateVars.components.ErrorPage && hasErrorLayout) { - templateVars.components.ErrorPage = this.relativeToBuild(this.options.srcDir, 'layouts/error') + templateVars.components.ErrorPage = this.relativeToBuild(this.options.srcDir, 'layouts/error.vue') } } // If no default layout, create its folder and add the default folder @@ -221,7 +221,7 @@ export default class Builder extends Tapable { // If user defined a custom method to create routes if (this._nuxtPages) { // Use nuxt.js createRoutes bases on pages/ - const files = await glob('pages/**/*.{vue,js}', { cwd: this.options.srcDir }) + const files = await glob('pages/**/*.vue', { cwd: this.options.srcDir }) templateVars.router.routes = createRoutes(files, this.options.srcDir) } else { templateVars.router.routes = this.options.build.createRoutes(this.options.srcDir) @@ -469,13 +469,13 @@ export default class Builder extends Tapable { r(this.options.srcDir, 'layouts'), r(this.options.srcDir, 'store'), r(this.options.srcDir, 'middleware'), - r(this.options.srcDir, 'layouts/*.{vue,js}'), - r(this.options.srcDir, 'layouts/**/*.{vue,js}') + r(this.options.srcDir, 'layouts/*.vue'), + r(this.options.srcDir, 'layouts/**/*.vue') ] if (this._nuxtPages) { patterns.push(r(this.options.srcDir, 'pages')) - patterns.push(r(this.options.srcDir, 'pages/*.{vue,js}')) - patterns.push(r(this.options.srcDir, 'pages/**/*.{vue,js}')) + patterns.push(r(this.options.srcDir, 'pages/*.vue')) + patterns.push(r(this.options.srcDir, 'pages/**/*.vue')) } const options = Object.assign({}, this.options.watchers.chokidar, { ignoreInitial: true