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) } }