Skip to content

Commit 4cf1d43

Browse files
committed
on compiler switch use esmodule by default
1 parent 6d4ed7f commit 4cf1d43

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/common/CompilerManagerHook.res

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,8 @@ let createUrl = (pathName, ready) => {
255255
url
256256
}
257257

258+
let defaultModuleSystem = "esmodule"
259+
258260
// ~initialLang:
259261
// The target language the compiler should be set to during
260262
// playground initialization. If the compiler doesn't support the language, it
@@ -268,7 +270,7 @@ let createUrl = (pathName, ready) => {
268270
// cases where the output didn't visually change)
269271
let useCompilerManager = (
270272
~initialVersion: option<Semver.t>=?,
271-
~initialModuleSystem="esmodule",
273+
~initialModuleSystem=defaultModuleSystem,
272274
~initialLang: Lang.t=Res,
273275
~onAction: option<action => unit>=?,
274276
~versions: array<Semver.t>,
@@ -485,7 +487,11 @@ let useCompilerManager = (
485487
let apiVersion = apiVersion->Version.fromString
486488
let open_modules = getOpenModules(~apiVersion, ~libraries)
487489

488-
let config = {...instance->Compiler.getConfig, ?open_modules}
490+
let config = {
491+
...instance->Compiler.getConfig,
492+
module_system: defaultModuleSystem,
493+
?open_modules,
494+
}
489495
instance->Compiler.setConfig(config)
490496

491497
let selected = {

0 commit comments

Comments
 (0)