File tree Expand file tree Collapse file tree 2 files changed +9
-4
lines changed Expand file tree Collapse file tree 2 files changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -21,6 +21,7 @@ const config = {
2121 ENV : process . env . NODE_ENV ,
2222 VERSION_LATEST : process . env . VERSION_LATEST ,
2323 VERSION_NEXT : process . env . VERSION_NEXT ,
24+ VERCEL : process . env . VERCEL ,
2425 } ,
2526 swcMinify : false ,
2627 webpack : ( config , options ) => {
Original file line number Diff line number Diff line change @@ -35,14 +35,18 @@ module LoadScript = {
3535}
3636
3737module 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`
4044
4145 let getLibraryCmijUrl = (version , libraryName : string ): string =>
42- ` /playground-bundles /${Semver.toString(version)}/${libraryName}/cmij.js`
46+ ` ${baseUrl} /${Semver.toString(version)}/${libraryName}/cmij.js`
4347
4448 let getStdlibRuntimeUrl = (version , filename ) =>
45- ` /playground-bundles /${Semver.toString(version)}/compiler-builtins/stdlib/${filename}`
49+ ` ${baseUrl} /${Semver.toString(version)}/compiler-builtins/stdlib/${filename}`
4650}
4751
4852module FinalResult = {
You can’t perform that action at this time.
0 commit comments