Skip to content

Commit

Permalink
validate if a postCSS config is an object (#1862)
Browse files Browse the repository at this point in the history
  • Loading branch information
DeMoorJasper authored Aug 16, 2018
1 parent ab386e7 commit a0821b6
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packages/core/parcel-bundler/src/transforms/postcss.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
};
Expand Down

0 comments on commit a0821b6

Please sign in to comment.