File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -107,14 +107,21 @@ def convert_filename(
107
107
except ValueError :
108
108
pass
109
109
if not filename .exists ():
110
+ # how node.js loads dependencies from node_modules:
111
+ # https://nodejs.org/api/modules.html#loading-from-node_modules-folders
110
112
if cwd .joinpath (Path ("node_modules" ), filename ).exists ():
111
113
filename = cwd .joinpath ("node_modules" , filename )
114
+ elif cwd .joinpath (Path ("../node_modules" ), filename ).exists ():
115
+ filename = cwd .joinpath ("contracts" , filename )
116
+ elif cwd .joinpath (Path ("../../node_modules" ), filename ).exists ():
117
+ filename = cwd .joinpath ("contracts" , filename )
112
118
elif cwd .joinpath (Path ("contracts" ), filename ).exists ():
113
119
filename = cwd .joinpath ("contracts" , filename )
114
120
elif working_dir .joinpath (filename ).exists ():
115
121
filename = working_dir .joinpath (filename )
116
122
else :
117
- raise InvalidCompilation (f"Unknown file: { filename } " )
123
+ test = cwd .joinpath (Path ("../node_modules" ), filename );
124
+ raise InvalidCompilation (f"Unknown file: { filename } { test } " )
118
125
elif not filename .is_absolute ():
119
126
filename = cwd .joinpath (filename )
120
127
You can’t perform that action at this time.
0 commit comments