Closed sapegin closed 3 years ago
I think trying to automagically guess the component name from the module name/path won't scale.
How about adding a getComponentName
option?
For example:
{
...
getComponentName: ({ imported, local, moduleName }) => {
const parts = moduleName.split('/');
return parts[parts.length - 1];
}
}
In #10, I basically suggest that the default is ({ imported, local }) => imported || local
instead of the current ({ local }) => local
.
Yeah, that would work I guess! 🦄
getComponentName
is available in 0.5.0.
Similar to #10 but with default imports:
The component name in the stats will be
DesignSystemIcon
instead of the correct oneIcon
.Not sure we should detect the name automatically in this case though. Maybe taking the last part of the path and give an ability to override this behavior would be a good solution?