File tree 2 files changed +9
-4
lines changed
2 files changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -21,6 +21,7 @@ const config = {
21
21
ENV : process . env . NODE_ENV ,
22
22
VERSION_LATEST : process . env . VERSION_LATEST ,
23
23
VERSION_NEXT : process . env . VERSION_NEXT ,
24
+ VERCEL : process . env . VERCEL ,
24
25
} ,
25
26
swcMinify : false ,
26
27
webpack : ( config , options ) => {
Original file line number Diff line number Diff line change @@ -35,14 +35,18 @@ module LoadScript = {
35
35
}
36
36
37
37
module CdnMeta = {
38
- let getCompilerUrl = (version ): string =>
39
- ` /playground-bundles/${Semver.toString(version)}/compiler.js`
38
+ let baseUrl = switch Node .Process .env -> Dict .get ("VERCEL" ) {
39
+ | Some (_ ) => "https://cdn.rescript-lang.org"
40
+ | None => "/playground-bundles"
41
+ }
42
+
43
+ let getCompilerUrl = (version ): string => ` ${baseUrl}/${Semver.toString(version)}/compiler.js`
40
44
41
45
let getLibraryCmijUrl = (version , libraryName : string ): string =>
42
- ` /playground-bundles /${Semver.toString(version)}/${libraryName}/cmij.js`
46
+ ` ${baseUrl} /${Semver.toString(version)}/${libraryName}/cmij.js`
43
47
44
48
let getStdlibRuntimeUrl = (version , filename ) =>
45
- ` /playground-bundles /${Semver.toString(version)}/compiler-builtins/stdlib/${filename}`
49
+ ` ${baseUrl} /${Semver.toString(version)}/compiler-builtins/stdlib/${filename}`
46
50
}
47
51
48
52
module FinalResult = {
You can’t perform that action at this time.
0 commit comments