react-icons
Version:
SVG React icons of popular icon packs using ES6 imports
17 lines (16 loc) • 403 B
JavaScript
module.exports = (babel, options) => {
return {
name: "default-import-converter",
visitor: {
ImportDeclaration(path) {
var spec = path.node.specifiers.map(
spec =>
options.keys.includes(spec.local.name)
? babel.types.ImportDefaultSpecifier(spec.local)
: spec
);
path.node.specifiers = spec;
}
}
};
};