Make handler optional in object plugins

This commit is contained in:
Adam Wathan 2019-10-12 13:46:51 -04:00
parent 53dff626a7
commit 94a1d30809
3 changed files with 44 additions and 6 deletions

View file

@ -29,7 +29,7 @@ export default function(plugins, config) {
const getConfigValue = (path, defaultValue) => _.get(config, path, defaultValue)
plugins.forEach(plugin => {
const handler = isFunction(plugin) ? plugin : plugin.handler
const handler = isFunction(plugin) ? plugin : _.get(plugin, 'handler', () => {})
handler({
postcss,