mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-29 18:52:19 +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[];
|
exports: string[];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function isLegacyFile(id: string): boolean {
|
||||||
|
return id.endsWith('.ts') && (
|
||||||
|
id.includes("src/extensions/core") ||
|
||||||
|
id.includes("src/scripts")
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
function comfyAPIPlugin(): Plugin {
|
function comfyAPIPlugin(): Plugin {
|
||||||
return {
|
return {
|
||||||
name: 'comfy-api-plugin',
|
name: 'comfy-api-plugin',
|
||||||
@@ -18,8 +25,7 @@ function comfyAPIPlugin(): Plugin {
|
|||||||
if (IS_DEV)
|
if (IS_DEV)
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
// TODO: Remove second condition after all js files are converted to ts
|
if (isLegacyFile(id)) {
|
||||||
if (id.endsWith('.ts') || (id.endsWith('.js') && id.includes("extensions/core"))) {
|
|
||||||
const result = transformExports(code, id);
|
const result = transformExports(code, id);
|
||||||
|
|
||||||
if (result.exports.length > 0) {
|
if (result.exports.length > 0) {
|
||||||
|
|||||||
Reference in New Issue
Block a user