refactor: small improvements (#4194)

This commit is contained in:
Alexander Lichter 2018-10-25 11:57:52 +01:00 committed by Pooya Parsa
parent a3ba6e96ca
commit 48393b33c7
2 changed files with 5 additions and 4 deletions

View File

@ -29,7 +29,8 @@ import {
relativeTo, relativeTo,
waitFor, waitFor,
determineGlobals, determineGlobals,
stripWhitespace stripWhitespace,
isString
} from '@nuxt/common' } from '@nuxt/common'
const glob = pify(Glob) const glob = pify(Glob)
@ -372,7 +373,7 @@ export default class Builder {
custom: customFileExists custom: customFileExists
} }
}) })
.filter(i => !!i) .filter(Boolean)
// -- Custom templates -- // -- Custom templates --
// Add custom template files // Add custom template files
@ -524,7 +525,7 @@ export default class Builder {
watchServer() { watchServer() {
const nuxtRestartWatch = concat( const nuxtRestartWatch = concat(
this.options.serverMiddleware this.options.serverMiddleware
.filter(i => typeof i === 'string') .filter(isString)
.map(this.nuxt.resolver.resolveAlias), .map(this.nuxt.resolver.resolveAlias),
this.options.watch.map(this.nuxt.resolver.resolveAlias), this.options.watch.map(this.nuxt.resolver.resolveAlias),
path.join(this.options.rootDir, 'nuxt.config.js') path.join(this.options.rootDir, 'nuxt.config.js')

View File

@ -99,7 +99,7 @@ export default class PostcssConfig {
const instance = plugin(opts) const instance = plugin(opts)
return instance return instance
}) })
.filter(e => e) .filter(Boolean)
} }
} }