fix(plugin-tools): load lazy plugins with default exports correctly
This commit is contained in:
parent
c68c6f0490
commit
60ae3b8c82
2 changed files with 11 additions and 0 deletions
5
.changeset/large-berries-marry.md
Normal file
5
.changeset/large-berries-marry.md
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
'@emigrate/plugin-tools': patch
|
||||
---
|
||||
|
||||
Fix loading of lazy loaded plugins with default exports
|
||||
|
|
@ -101,6 +101,12 @@ export const getOrLoadPlugins = async <T extends PluginType>(
|
|||
continue;
|
||||
}
|
||||
|
||||
// Support export default ...
|
||||
if (plugin && typeof plugin === 'object' && 'default' in plugin && isPluginOfType(type, plugin.default)) {
|
||||
result.push(plugin.default);
|
||||
continue;
|
||||
}
|
||||
|
||||
const loadedPlugin = typeof plugin === 'string' ? await loadPlugin(type, plugin) : undefined;
|
||||
|
||||
if (loadedPlugin) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue