Skip to content

Commit 5a836b7

Browse files
committed
fix: prepare plugin with empty options, close #2
1 parent 35be021 commit 5a836b7

File tree

1 file changed

+5
-13
lines changed

1 file changed

+5
-13
lines changed

lib/plugins.js

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -35,19 +35,11 @@ module.exports = function plugins (config) {
3535
} else {
3636
config = config.plugins
3737

38-
const load = (plugin, options) => {
39-
if (options === null || Object.keys(options).length === 0) {
40-
try {
41-
return require(plugin)
42-
} catch (err) {
43-
console.log(err)
44-
}
45-
} else {
46-
try {
47-
return require(plugin)(options)
48-
} catch (err) {
49-
console.log(err)
50-
}
38+
const load = (plugin, options = {}) => {
39+
try {
40+
return require(plugin)(options)
41+
} catch (err) {
42+
console.log(err)
5143
}
5244
}
5345

0 commit comments

Comments
 (0)