Skip to content
This repository was archived by the owner on Jul 29, 2025. It is now read-only.

Commit f26f04e

Browse files
authored
fix: skip template files that are not transpiled (#245)
1 parent 47eb245 commit f26f04e

File tree

1 file changed

+4
-11
lines changed

1 file changed

+4
-11
lines changed

src/renderer/template.ts

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -50,17 +50,10 @@ function importComponent(filepath: string): Promise<TemplateFunction | undefined
5050
if (require === undefined) resolve(undefined);
5151

5252
let componentPath = filepath;
53-
54-
// Check if the file exists
55-
if (!fs.existsSync(componentPath)) {
56-
// If transpiled version doesn't exist, try the original version
57-
const originalPath = componentPath.replace('__transpiled', 'template');
58-
if (fs.existsSync(originalPath)) {
59-
componentPath = originalPath;
60-
} else {
61-
throw new Error(`Neither transpiled nor original template file found: ${filepath}`);
62-
}
63-
}
53+
54+
// Check if the transpiled version of the template file exists and skip if doesn't
55+
//It is needed to support case where you have template files, but do not want to use them yet
56+
if (!fs.existsSync(componentPath)) resolve(undefined);
6457

6558
// Remove from cache and require the file
6659
delete require.cache[require.resolve(componentPath)];

0 commit comments

Comments
 (0)