From 48393b33c73c5039dbb9f0f76f0e22055ae4a040 Mon Sep 17 00:00:00 2001 From: Alexander Lichter Date: Thu, 25 Oct 2018 11:57:52 +0100 Subject: [PATCH] refactor: small improvements (#4194) --- packages/builder/src/builder.js | 7 ++++--- packages/webpack/src/config/utils/postcss.js | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/packages/builder/src/builder.js b/packages/builder/src/builder.js index 9a1b35171a..1e1ca70897 100644 --- a/packages/builder/src/builder.js +++ b/packages/builder/src/builder.js @@ -29,7 +29,8 @@ import { relativeTo, waitFor, determineGlobals, - stripWhitespace + stripWhitespace, + isString } from '@nuxt/common' const glob = pify(Glob) @@ -372,7 +373,7 @@ export default class Builder { custom: customFileExists } }) - .filter(i => !!i) + .filter(Boolean) // -- Custom templates -- // Add custom template files @@ -524,7 +525,7 @@ export default class Builder { watchServer() { const nuxtRestartWatch = concat( this.options.serverMiddleware - .filter(i => typeof i === 'string') + .filter(isString) .map(this.nuxt.resolver.resolveAlias), this.options.watch.map(this.nuxt.resolver.resolveAlias), path.join(this.options.rootDir, 'nuxt.config.js') diff --git a/packages/webpack/src/config/utils/postcss.js b/packages/webpack/src/config/utils/postcss.js index 51674bbad7..0d011ecc0c 100644 --- a/packages/webpack/src/config/utils/postcss.js +++ b/packages/webpack/src/config/utils/postcss.js @@ -99,7 +99,7 @@ export default class PostcssConfig { const instance = plugin(opts) return instance }) - .filter(e => e) + .filter(Boolean) } }