File tree Expand file tree Collapse file tree 1 file changed +12
-3
lines changed
resolver/src/resolver/resolve-dependencies Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change 3
3
MacroNode ,
4
4
MacroNodeDefinition ,
5
5
} from "@flyde/core" ;
6
- import { readFileSync } from "fs" ;
6
+ import { readFileSync , existsSync } from "fs" ;
7
7
import { join } from "path" ;
8
8
9
9
export function macroNodeToDefinition < T > (
@@ -21,11 +21,20 @@ export function macroNodeToDefinition<T>(
21
21
editorComponentBundleContent : "" ,
22
22
} as MacroEditorConfigCustomDefinition ,
23
23
} ;
24
- const editorComponentPath = join (
25
- importPath ,
24
+ const BundlePathPlusOne = join (
26
25
".." ,
27
26
macro . editorConfig . editorComponentBundlePath ,
28
27
) ;
28
+ let editorComponentPath = join (
29
+ importPath ,
30
+ BundlePathPlusOne ,
31
+ ) ;
32
+ if ( ! existsSync ( editorComponentPath ) ) {
33
+ editorComponentPath = join (
34
+ importPath ,
35
+ macro . editorConfig . editorComponentBundlePath ,
36
+ )
37
+ }
29
38
30
39
try {
31
40
const content = readFileSync ( editorComponentPath , "utf8" ) ;
You can’t perform that action at this time.
0 commit comments