Skip to content

Commit fc481f2

Browse files
committed
load from prod CDN in dev
1 parent 89df687 commit fc481f2

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

src/bindings/Node.res

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ module Process = {
1616
@scope("process") external env: Dict.t<string> = "env"
1717
@scope("process") @val external argv: array<string> = "argv"
1818
@scope("process") external exit: int => unit = "exit"
19+
module Env = {
20+
@scope(("process", "env")) external nodeEnv: string = "NODE_ENV"
21+
}
1922
}
2023

2124
module Fs = {

src/common/CompilerManagerHook.res

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,10 @@ module LoadScript = {
3535
}
3636

3737
module CdnMeta = {
38-
let baseUrl = "/playground-bundles"
38+
let baseUrl =
39+
Node.Process.Env.nodeEnv === "development"
40+
? "https://cdn.rescript-lang.org"
41+
: "" + "/playground-bundles"
3942

4043
let getCompilerUrl = (version): string => `${baseUrl}/${Semver.toString(version)}/compiler.js`
4144

0 commit comments

Comments
 (0)