Files
ComfyUI_frontend/babel-plugin-stub-vue.js
snomiao 540b6f3d26 fix: Add babel configuration for Playwright to handle TypeScript declare fields
- Configure babel plugins for TypeScript with allowDeclareFields option
- Add module resolver for @ alias to src directory
- Create custom babel plugin to stub Vue/CSS imports
- Add browser globals polyfill using happy-dom for Node.js context
- Update playwright.i18n.config.ts with babel configuration

This enables collect-i18n tests to run with proper TypeScript and module transformations.
2025-09-12 08:16:37 +00:00

18 lines
521 B
JavaScript

module.exports = function() {
return {
visitor: {
ImportDeclaration(path) {
const source = path.node.source.value;
if (source.endsWith('.vue')) {
// Replace Vue component imports with a stub
const specifiers = path.node.specifiers;
if (specifiers.length > 0) {
const name = specifiers[0].local.name;
// Create a simple stub object
path.replaceWithSourceString(`const ${name} = {};`);
}
}
}
}
};
};