mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-21 06:49:37 +00:00
- Renamed babel-plugin-stub-vue-imports.js to .cjs extension - Changed from ES module exports to CommonJS module.exports - Updated playwright.i18n.config.ts to use correct file path with __dirname - Added import.meta.url handling for ES module compatibility This fixes the module resolution errors when running pnpm collect-i18n
32 lines
967 B
JavaScript
32 lines
967 B
JavaScript
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();
|
|
}
|
|
}
|
|
}
|
|
};
|
|
}; |