How to use the ImportDefaultSpecifier function from @babel/core

Find comprehensive JavaScript @babel/core.ImportDefaultSpecifier code examples handpicked from public code repositorys.

90
91
92
93
94
95
96
97
98
99

return t.importDeclaration(
    // [t.importSpecifier(t.identifier(local), t.identifier(imported))],
    [
        !ret.ref || ret.ref === 'default'
            ? t.ImportDefaultSpecifier(t.identifier(local))
            : t.ImportSpecifier(t.identifier(local), t.identifier(ret.ref)),
    ],
    t.stringLiteral(typeof ret === 'string' ? ret : ret.moduleName),
);
fork icon0
star icon1
watch icon0