mirror of
https://github.com/zhigang1992/styled-components.git
synced 2026-01-12 22:52:39 +08:00
alias emotion dep so version can be displayed
This commit is contained in:
@@ -3,11 +3,15 @@ import packageJson from '../package.json';
|
||||
const context = require.context('./implementations/', true, /index\.js$/);
|
||||
const { dependencies } = packageJson;
|
||||
|
||||
const dependencyMap = {
|
||||
emotion: '@emotion/styled',
|
||||
};
|
||||
|
||||
const toImplementations = context =>
|
||||
context.keys().map(path => {
|
||||
const components = context(path).default;
|
||||
const name = path.split('/')[1];
|
||||
const version = dependencies[name] || '';
|
||||
const version = dependencies[dependencyMap[name] || name] || '';
|
||||
return { components, name, version };
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user