Skip to content

Commit 7da803f

Browse files
authored
fix(react-email): hot reloading failing with tailwind.config-like imports (#2590)
1 parent 733dc39 commit 7da803f

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

.changeset/true-waves-punch.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@react-email/preview-server": patch
3+
---
4+
5+
fix imports of files with implicit extensions, and secondary segment like `.spec` failing to hot reload

packages/react-email/src/utils/preview/hot-reloading/create-dependency-graph.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,8 +150,13 @@ export const createDependencyGraph = async (directory: string) => {
150150
) {
151151
return pathToDependencyFromDirectory;
152152
}
153+
if (javascriptExtensions.includes(extension)) {
154+
return checkFileExtensionsUntilItExists(
155+
pathToDependencyFromDirectory.replace(extension, ''),
156+
);
157+
}
153158
return checkFileExtensionsUntilItExists(
154-
pathToDependencyFromDirectory.replace(extension, ''),
159+
pathToDependencyFromDirectory,
155160
);
156161
})();
157162

0 commit comments

Comments
 (0)