We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c02ca45 commit db6d3d4Copy full SHA for db6d3d4
lib/module/index.js
@@ -24,10 +24,13 @@ module.exports = function (moduleOptions) {
24
delete options.strategies
25
26
// Set defaultStrategy
27
- if (!options.defaultStrategy && strategies.length) {
28
- options.defaultStrategy = strategies[0]._name
29
- } else {
+ const strategyNames = strategies.map(x => x._name)
+ options.defaultStrategy = options.defaultStrategy || strategyNames[0]
+
30
+ if (!options.defaultStrategy) {
31
logger.warn('no strategy defined!')
32
+ } else if(strategyNames.indexOf(options.defaultStrategy) === -1) {
33
+ logger.warn(`strategy ${options.defaultStrategy} is not defined!`)
34
}
35
36
// Copy plugin
0 commit comments