File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
packages/react-email/src/cli/utils/preview/hot-reloading Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -2,8 +2,14 @@ import { parse } from '@babel/parser';
2
2
3
3
import traverseModule from '@babel/traverse' ;
4
4
5
- // @ts -expect-error This is fine since the default export is wrapped in a default function. The problem is that babel/traverse is not ESM.
6
- const traverse = traverseModule . default ;
5
+ const traverse =
6
+ // we keep this check here so that this still works with the dev:preview
7
+ // script's use of tsx
8
+ typeof traverseModule === 'function'
9
+ ? traverseModule
10
+ : // @ts -expect-error This is fine since the default export is wrapped in a
11
+ // default function. The problem is that babel/traverse is not ESM.
12
+ traverseModule . default ;
7
13
8
14
export const getImportedModules = ( contents : string ) => {
9
15
const importedPaths : string [ ] = [ ] ;
You can’t perform that action at this time.
0 commit comments