Skip to content

Commit 324acbe

Browse files
committed
Fix finding the standard library for pnpm some more
1 parent dcd0560 commit 324acbe

File tree

1 file changed

+17
-5
lines changed

1 file changed

+17
-5
lines changed

compiler/ext/config.ml

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,24 @@ let standard_library =
1212
|> List.rev
1313
with
1414
(* 1. Packages installed via pnpm
15-
- bin: node_modules/.pnpm/@rescript+darwin-arm64@12.0.0-alpha.13/node_modules/@rescript/darwin-arm64/bin
16-
- stdlib: node_modules/rescript/lib/ocaml (symlink)
15+
- bin: node_modules/.pnpm/@rescript+darwin-arm64@12.0.0-alpha.15/node_modules/@rescript/darwin-arm64/bin
16+
- stdlib: node_modules/.pnpm/rescript@12.0.0-alpha.15/node_modules/rescript/lib/ocaml
1717
*)
18-
| "bin" :: _platform :: "@rescript" :: "node_modules" :: _package :: ".pnpm"
19-
:: "node_modules" :: rest ->
20-
build_path rest ["node_modules"; "rescript"; "lib"; "ocaml"]
18+
| "bin" :: _platform :: "@rescript" :: "node_modules" :: binPackage :: ".pnpm"
19+
:: "node_modules" :: rest -> (
20+
match binPackage |> String.split_on_char '@' with
21+
| [""; _packageName; version] ->
22+
build_path rest
23+
[
24+
"node_modules";
25+
".pnpm";
26+
"rescript@" ^ version;
27+
"node_modules";
28+
"rescript";
29+
"lib";
30+
"ocaml";
31+
]
32+
| _ -> "")
2133
(* 2. Packages installed via npm
2234
- bin: node_modules/@rescript/{platform}/bin
2335
- stdlib: node_modules/rescript/lib/ocaml

0 commit comments

Comments
 (0)