mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-01-26 19:09:52 +00:00
Only shim legacy directories (#395)
* Only shim legacy directories * nit
This commit is contained in:
@@ -11,6 +11,13 @@ interface ShimResult {
|
||||
exports: string[];
|
||||
}
|
||||
|
||||
function isLegacyFile(id: string): boolean {
|
||||
return id.endsWith('.ts') && (
|
||||
id.includes("src/extensions/core") ||
|
||||
id.includes("src/scripts")
|
||||
);
|
||||
}
|
||||
|
||||
function comfyAPIPlugin(): Plugin {
|
||||
return {
|
||||
name: 'comfy-api-plugin',
|
||||
@@ -18,8 +25,7 @@ function comfyAPIPlugin(): Plugin {
|
||||
if (IS_DEV)
|
||||
return null;
|
||||
|
||||
// TODO: Remove second condition after all js files are converted to ts
|
||||
if (id.endsWith('.ts') || (id.endsWith('.js') && id.includes("extensions/core"))) {
|
||||
if (isLegacyFile(id)) {
|
||||
const result = transformExports(code, id);
|
||||
|
||||
if (result.exports.length > 0) {
|
||||
|
||||
Reference in New Issue
Block a user