Skip to content

Commit

Permalink
fix(Cooker): custom providers should be executed with config before b…
Browse files Browse the repository at this point in the history
…eing added
  • Loading branch information
gaspard authored and henri-hulski committed Mar 11, 2021
1 parent 0f99bc7 commit 15f97a5
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Cooker/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,16 @@ export function Cooker(argv, theOptions) {
}
const config = createConfig(options)
const use = (builtin ? builtin.use : options.use) || USE_ALL
const customProviders = options.providers || {}
const ft = new FunctionTree(
Object.assign(
{ config },
...Object.keys(use)
.filter(k => use[k])
.map(k => ({ [k]: provide(PROVIDER[k], config) })),
options.providers || {}
...Object.keys(customProviders).map(k => ({
[k]: customProviders[k](config),
}))
)
)

Expand Down

0 comments on commit 15f97a5

Please sign in to comment.