diff --git a/CHANGELOG.md b/CHANGELOG.md index 57bddf8a89..a4d3077480 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,7 @@ - Remove support for `bsconfig.json`. https://github.com/rescript-lang/rescript/pull/8187 - `Int.fromString` and `Float.fromString` use stricter number parsing and no longer uses an explicit radix argument, but instead supports parsing hexadecimal, binary and exponential notation. - Remove the deprecated module system names `es6` and `es6-global` (superseded by `esmodule`). https://github.com/rescript-lang/rescript/pull/8205 +- Default to module system `esmodule`. https://github.com/rescript-lang/rescript/pull/8213 - Remove `external-stdlib` configuration option from `rescript.json`. This option was rarely used and is no longer supported. - `js-post-build` now passes the correct output file path based on `in-source` configuration: when `in-source: true`, the path next to the source file is passed; when `in-source: false`, the path in the `lib//` directory is passed. Additionally, stdout and stderr from the post-build command are now logged. https://github.com/rescript-lang/rescript/pull/8190 - `js-post-build` command now runs in the directory containing the `rescript.json` where it is defined, instead of the unpredictable build invocation directory. This provides consistent behavior in monorepos. https://github.com/rescript-lang/rescript/pull/8195 diff --git a/docs/docson/build-schema.json b/docs/docson/build-schema.json index 03d4c29b9f..af78908ea8 100644 --- a/docs/docson/build-schema.json +++ b/docs/docson/build-schema.json @@ -3,7 +3,7 @@ "definitions": { "module-format": { "enum": ["esmodule", "commonjs"], - "description": "Output module format. Default: commonjs." + "description": "Output module format. Default: esmodule." }, "suffix-spec": { "type": "string", diff --git a/rewatch/CompilerConfigurationSpec.md b/rewatch/CompilerConfigurationSpec.md index 9f2b79d69e..49a14b01f5 100644 --- a/rewatch/CompilerConfigurationSpec.md +++ b/rewatch/CompilerConfigurationSpec.md @@ -154,7 +154,9 @@ stdout and stderr from the command are logged. ### Module-Format -enum: "commonjs" | "esmodule" +enum: "esmodule" | "commonjs" + +default: "esmodule" ### Suffix diff --git a/rewatch/src/config.rs b/rewatch/src/config.rs index dbad819cb7..7421c6664c 100644 --- a/rewatch/src/config.rs +++ b/rewatch/src/config.rs @@ -644,7 +644,7 @@ impl Config { pub fn get_package_specs(&self) -> Vec { match self.package_specs.clone() { None => vec![PackageSpec { - module: PackageModule::CommonJs, + module: PackageModule::EsModule, in_source: true, suffix: Some(".js".to_string()), }],