From 834cd25a239bf7e8e3ddc0fab42914d381b687df Mon Sep 17 00:00:00 2001 From: DeMoorJasper Date: Tue, 7 Aug 2018 16:18:52 -0700 Subject: [PATCH] validate if a postCSS config is an object --- src/transforms/postcss.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/transforms/postcss.js b/src/transforms/postcss.js index 370935674c3..9fefc708b6e 100644 --- a/src/transforms/postcss.js +++ b/src/transforms/postcss.js @@ -29,6 +29,11 @@ async function getConfig(asset) { } config = config || {}; + + if (typeof config !== 'object') { + throw new Error('PostCSS config should be an object.'); + } + let postcssModulesConfig = { getJSON: (filename, json) => (asset.cssModules = json) };