Skip to content

Commit 5ad96da

Browse files
feat: KGP compiler arguments for Js update (#4771)
* This PR updates the KGP compiler arguments for Js * Yahor review * chore: remove typedArrays
1 parent b8c8e9e commit 5ad96da

File tree

2 files changed

+15
-12
lines changed

2 files changed

+15
-12
lines changed

docs/topics/compiler-reference.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,10 @@ The command-line tool for Kotlin to JS compilation is `kotlinc-js`.
217217

218218
In addition to the [common options](#common-options), Kotlin/JS compiler has the options listed below.
219219

220+
### -target {es5|es2015}
221+
222+
Generate JS files for the specified ECMA version.
223+
220224
### -libraries _path_
221225

222226
Paths to Kotlin libraries with `.meta.js` and `.kjsm` files, separated by the system path separator.

docs/topics/gradle/gradle-compiler-options.md

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -364,18 +364,17 @@ Also, see [Types for compiler options](#types-for-compiler-options).
364364

365365
### Attributes specific to JavaScript
366366

367-
| Name | Description | Possible values |Default value |
368-
|---|---|---|---|
369-
| `friendModulesDisabled` | Disable internal declaration export| | false |
370-
| `main` | Define whether the `main` function should be called upon execution | "call", "noCall". Also, see [Types for compiler options](#types-for-compiler-options) | "call" |
371-
| `metaInfo` | Generate .meta.js and .kjsm files with metadata. Use to create a library | | true |
372-
| `moduleKind` | The kind of JS module generated by the compiler | "umd", "commonjs", "amd", "plain", "es". Also, see [Types for compiler options](#types-for-compiler-options) | "umd" |
373-
| `sourceMap` | Generate source map | | true |
374-
| `sourceMapEmbedSources` | Embed source files into the source map | "never", "always", "inlining". Also, see [Types for compiler options](#types-for-compiler-options) | |
375-
| `sourceMapNamesPolicy` | Add variable and function names that you declared in Kotlin code into the source map. For more information on the behavior, see our [compiler reference](compiler-reference.md#source-map-names-policy-simple-names-fully-qualified-names-no). | "simple-names", "fully-qualified-names", "no". Also, see [Types for compiler options](#types-for-compiler-options) | "simple-names" |
376-
| `sourceMapPrefix` | Add the specified prefix to paths in the source map | | |
377-
| `target` | Generate JS files for specific ECMA version | "v5" | "v5" |
378-
| `typedArrays` | Translate primitive arrays to JS typed arrays | | true |
367+
| Name | Description | Possible values | Default value |
368+
|---|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------|
369+
| `friendModulesDisabled` | Disable internal declaration export | | `false` |
370+
| `main` | Specify whether the `main` function should be called upon execution | `JsMainFunctionExecutionMode.CALL`, `JsMainFunctionExecutionMode.NO_CALL` | `JsMainFunctionExecutionMode.CALL` |
371+
| `moduleKind` | The kind of JS module generated by the compiler | `JsModuleKind.MODULE_AMD`, `JsModuleKind.MODULE_PLAIN`, `JsModuleKind.MODULE_ES`, `JsModuleKind.MODULE_COMMONJS`, `JsModuleKind.MODULE_UMD` | `null` |
372+
| `sourceMap` | Generate source map | | `false` |
373+
| `sourceMapEmbedSources` | Embed source files into the source map | `JsSourceMapEmbedMode.SOURCE_MAP_SOURCE_CONTENT_INLINING`, `JsSourceMapEmbedMode.SOURCE_MAP_SOURCE_CONTENT_NEVER`, `JsSourceMapEmbedMode.SOURCE_MAP_SOURCE_CONTENT_ALWAYS` | `null` |
374+
| `sourceMapNamesPolicy` | Add variable and function names that you declared in Kotlin code into the source map. For more information on the behavior, see our [compiler reference](compiler-reference.md#source-map-names-policy-simple-names-fully-qualified-names-no) | `JsSourceMapNamesPolicy.SOURCE_MAP_NAMES_POLICY_FQ_NAMES`, `JsSourceMapNamesPolicy.SOURCE_MAP_NAMES_POLICY_SIMPLE_NAMES`, `JsSourceMapNamesPolicy.SOURCE_MAP_NAMES_POLICY_NO` | `null` |
375+
| `sourceMapPrefix` | Add the specified prefix to paths in the source map | | `null` |
376+
| `target` | Generate JS files for specific ECMA version | `"es5"`, `"es2015"` | `"es5"` |
377+
| `useEsClasses` | Let generated JavaScript code use ES2015 classes. Enabled by default in case of ES2015 target usage | | `null` |
379378

380379
### Types for compiler options
381380

0 commit comments

Comments
 (0)