chore(babel-plugin-stub-vue-imports): remove unused Babel plugin for stubbing Vue imports to clean up the codebase

This commit is contained in:
snomiao
2025-09-24 19:35:58 +00:00
parent 89465ded57
commit 8560646be2

View File

@@ -1,32 +0,0 @@
module.exports = function(babel) {
const { types: t } = babel;
return {
visitor: {
ImportDeclaration(path) {
const source = path.node.source.value;
// Handle Vue files
if (source.endsWith('.vue')) {
const specifiers = path.node.specifiers;
if (specifiers.length > 0 && specifiers[0].type === 'ImportDefaultSpecifier') {
const name = specifiers[0].local.name;
// Replace with a variable declaration
path.replaceWith(
t.variableDeclaration('const', [
t.variableDeclarator(
t.identifier(name),
t.objectExpression([])
)
])
);
}
}
// Handle CSS files - just remove the import
else if (source.endsWith('.css') || source.endsWith('.scss') || source.endsWith('.less')) {
path.remove();
}
}
}
};
};