Skip to content

Commit a19069f

Browse files
committed
Fix import bug with wrong paths.
bsc compiles the import statements into "module_name/absolute_path" without this fix because -bs-package-output doesn't support absolute paths.
1 parent 82a97a9 commit a19069f

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

jscomp/core/js_packages_info.ml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,14 @@ let string_of_module_id
227227
| Package_found(dep_package_name, dep_path),
228228
Package_script
229229
->
230+
#if BS_NATIVE then
231+
if Filename.is_relative dep_path then
232+
dep_package_name // dep_path // js_file
233+
else
234+
dep_path // js_file
235+
#else
230236
dep_package_name // dep_path // js_file
237+
#end
231238

232239
| Package_found(dep_package_name, dep_path),
233240
Package_found(cur_package_name, cur_path) ->
@@ -242,7 +249,14 @@ let string_of_module_id
242249
else
243250
begin match module_system with
244251
| AmdJS | NodeJS | Es6 ->
252+
#if BS_NATIVE then
253+
if Filename.is_relative dep_path then
254+
dep_package_name // dep_path // js_file
255+
else
256+
dep_path // js_file
257+
#else
245258
dep_package_name // dep_path // js_file
259+
#end
246260
(** Note we did a post-processing when working on Windows *)
247261
| Es6_global
248262
| AmdJS_global ->

0 commit comments

Comments
 (0)