Merge pull request #1293 from benface/config-fn-fix

Fix plugin.withOptions() when no config function is passed
This commit is contained in:
Adam Wathan 2020-01-04 12:31:55 -05:00 • committed by GitHub
commit ac21390cee
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -9,7 +9,7 @@ createPlugin.withOptions = function(pluginFunction, configFunction) {
const optionsFunction = function(options) {
return {
handler: pluginFunction(options),
config: configFunction(options),
config: configFunction ? configFunction(options) : {},
}
}