Skip to content

Commit 0c82d0a

Browse files
authored
Default to esmodule (#8213)
* Default to esmodule * CHANGELOG * Update docs/docson/build-schema.json
1 parent 6c2bebe commit 0c82d0a

4 files changed

Lines changed: 6 additions & 3 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
- Remove support for `bsconfig.json`. https://github.com/rescript-lang/rescript/pull/8187
1919
- `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.
2020
- Remove the deprecated module system names `es6` and `es6-global` (superseded by `esmodule`). https://github.com/rescript-lang/rescript/pull/8205
21+
- Default to module system `esmodule`. https://github.com/rescript-lang/rescript/pull/8213
2122
- Remove `external-stdlib` configuration option from `rescript.json`. This option was rarely used and is no longer supported.
2223
- Remove the deprecated uncurried `(. args) => ...` function syntax. https://github.com/rescript-lang/rescript/pull/8211
2324
- `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/<module>/` directory is passed. Additionally, stdout and stderr from the post-build command are now logged. https://github.com/rescript-lang/rescript/pull/8190

docs/docson/build-schema.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"definitions": {
44
"module-format": {
55
"enum": ["esmodule", "commonjs"],
6-
"description": "Output module format. Default: commonjs."
6+
"description": "Output module format. Default: esmodule."
77
},
88
"suffix-spec": {
99
"type": "string",

rewatch/CompilerConfigurationSpec.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,9 @@ stdout and stderr from the command are logged.
154154

155155
### Module-Format
156156

157-
enum: "commonjs" | "esmodule"
157+
enum: "esmodule" | "commonjs"
158+
159+
default: "esmodule"
158160

159161
### Suffix
160162

rewatch/src/config.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -644,7 +644,7 @@ impl Config {
644644
pub fn get_package_specs(&self) -> Vec<PackageSpec> {
645645
match self.package_specs.clone() {
646646
None => vec![PackageSpec {
647-
module: PackageModule::CommonJs,
647+
module: PackageModule::EsModule,
648648
in_source: true,
649649
suffix: Some(".js".to_string()),
650650
}],

0 commit comments

Comments
 (0)