1
0
mirror of https://github.com/sahadev/vue-component-creater-ui.git synced 2025-12-20 01:35:49 +08:00
This commit is contained in:
shangbin
2021-04-09 20:06:44 +08:00
commit e87ebafdcb
97 changed files with 33753 additions and 0 deletions

18
src/utils/get-imports.js Normal file
View File

@@ -0,0 +1,18 @@
export default function(code, { imports }) {
return {
name: 'get-imports',
visitor: {
ImportDeclaration(path) {
imports.push({
variables: path.node.specifiers.map(spec => ({
local: spec.local.name,
imported: spec.imported ? spec.imported.name : 'default'
})),
module: path.node.source.value
});
path.remove();
}
}
};
}