From df95049c1e53d83e3e8c51ed7e272615c046d44c Mon Sep 17 00:00:00 2001 From: Michael Ciniawsky Date: Tue, 9 May 2017 00:15:49 +0200 Subject: [PATCH] fix(index): 'No PostCSS Config found' (`options.config`) --- lib/index.js | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/lib/index.js b/lib/index.js index 7ef9763c..a4da252c 100644 --- a/lib/index.js +++ b/lib/index.js @@ -72,11 +72,17 @@ module.exports = function loader (css, map) { const sourceMap = options.sourceMap Promise.resolve().then(() => { - if ( - Object.keys(options).length !== 0 || - ((rc || sourceMap) && Object.keys(options).length > 1) || - ((rc && sourceMap) && Object.keys(options).length > 2) - ) { + const length = Object.keys(options).length + + // TODO + // Deuglify + if (!options.config && !sourceMap && length) { + return parseOptions.call(this, options) + } else if (options.config && !sourceMap && length > 1) { + return parseOptions.call(this, options) + } else if (!options.config && sourceMap && length > 1) { + return parseOptions.call(this, options) + } else if (options.config && sourceMap && length > 2) { return parseOptions.call(this, options) }