Skip to content

Commit e199219

Browse files
ambarjaredpalmer
authored andcommitted
add support for function as plugin (#704)
1 parent 5b1ff8c commit e199219

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

packages/razzle/config/runPlugin.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ function runPlugin(plugin, config, { target, dev }, webpack) {
66
return runPlugin({ name: plugin }, config, { target, dev }, webpack);
77
}
88

9+
if (typeof plugin === 'function') {
10+
return plugin(config, { target, dev }, webpack);
11+
}
12+
913
if (typeof plugin.func === 'function') {
1014
// Used for writing plugin tests
1115
return plugin.func(config, { target, dev }, webpack, plugin.options);

0 commit comments

Comments
 (0)