You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
|`privateIn` ([proposal](https://github.com/tc39/proposal-private-fields-in-in)) |`#p in obj`|
|`v7.22.0`| Added support for `version: "2023-05"`|
87
88
|`v7.21.0`| Added support for `version: "2023-01"`|
88
89
|`v7.19.0`| Added support for `version: "2022-03"`|
89
90
|`v7.17.0`| Added the `version` option with support for `"2021-12"`, `"2018-09"` and `"legacy"`|
90
91
</details>
91
92
92
93
### `version`
93
94
94
-
`"2023-01"`, `"2022-03"`, `"2021-12"`, `"2018-09"` or `"legacy"`.
95
+
`"2023-05"`, `"2023-01"`, `"2022-03"`, `"2021-12"`, `"2018-09"` or `"legacy"`.
95
96
96
97
Selects the decorators proposal to use:
98
+
-`"2023-05"` is the proposal version after the updates that reached consensus in the March and May 2023 TC39 meetings, integrating [these changes](https://github.com/pzuraq/ecma262/compare/e86128e13b63a3c2efc3728f76c8332756752b02...c4465e44d514c6c1dba810487ec2721ccd6b08f9).
97
99
-`"2023-01"` is the proposal version after the updates that reached consensus in the January 2023 TC39 meeting, integrating [`pzuraq/ecma262#4`](https://github.com/pzuraq/ecma262/pull/4).
98
100
-`"2022-03"` is the proposal version that reached consensus for Stage 3 in the March 2022 TC39 meeting. You can read more about it at [`tc39/proposal-decorators@8ca65c046d`](https://github.com/tc39/proposal-decorators/tree/8ca65c046dd5e9aa3846a1fe5df343a6f7efd9f8).
99
101
-`"2021-12"` is the proposal version as it was presented to TC39 in Dec 2021. You can read more about it at [`tc39/proposal-decorators@d6c056fa06`](https://github.com/tc39/proposal-decorators/tree/d6c056fa061646178c34f361bad33d583316dc85).
@@ -107,7 +109,7 @@ If you specify the `decoratorsBeforeExport` option, `version` defaults to `"2018
107
109
### `decoratorsBeforeExport`
108
110
109
111
This option:
110
-
- is disallowed when using `version: "legacy"`, `version: "2022-03"`, or `version: "2023-01"`;
112
+
- is disallowed when using `version: "legacy"`, `version: "2022-03"`, `version: "2023-01"`, or `version: "2023-05"`;
111
113
- is required when using `version: "2018-09"`;
112
114
- is optional and defaults to `false` when using `version: "2021-12"`.
113
115
@@ -155,7 +157,7 @@ If you are already using `@babel/preset-env`, you can safely remove `@babel/plug
[Try it on the REPL](https://babeljs.io/repl#?build=&builtIns=false&corejs=3.28&spec=false&loose=false&code_lz=K4Zwlgdg5gBAFgQwgEwDYFMBOBlAnhAYxgF4YB7AB3Qj0IAoBKAbgCgEB3BMAFxlEliIUGTAEEQ-IqQ5delauMmMmQA&debug=false&forceAllTransforms=false&modules=false&shippedProposals=false&circleciRepo=&evaluate=false&fileSize=false&timeTravel=false&sourceType=module&lineWrap=true&presets=react&prettier=false&targets=&externalPlugins=%40babel%2Fplugin-proposal-explicit-resource-management%407.22.0%2C%40babel%2Fplugin-external-helpers%407.18.6&assumptions=%7B%7D).
This plugin will generate code that is not compatible with the current ECMAScript specification or with any currently proposed addition to it. Only use it when you are shipping native ES modules and you need compatibility exclusively with tools that don't support the Import Attributes syntax (`import pkg from "./package.json" with { type: "json" }`) but support the old Import Assertions syntax (`import pkg from "./package.json" assert { type: "json" }`), such as Chrome 91+ and Node.js 17.2+.
> **NOTE**: This plugin is included in `@babel/preset-env`, in [ES2024](https://github.com/tc39/proposals/blob/master/finished-proposals.md)
8
+
7
9
This plugin transforms regular expressions using the `v` flag, introduced by the [RegExp set notation + properties of strings](https://github.com/tc39/proposal-regexp-set-notation) proposal, to regular expressions that use the `u` flag.
> This plugin only enables Babel to parse this syntax. Babel does not support transforming this syntax
9
+
> It's unlikely you want to use this plugin directly as it only enables Babel to parse this syntax. Instead, use [plugin-proposal-explicit-resource-management](plugin-proposal-explicit-resource-management.md) to _both_ parse and transform this syntax.
10
+
11
+
<details>
12
+
<summary>History</summary>
13
+
14
+
| Version | Changes |
15
+
| --- | --- |
16
+
| v7.22.0 | Supports `await using`|
17
+
</details>
10
18
11
19
This plugin enables Babel to parse using declarations:
See options for [`@babel/plugin-transform-modules-commonjs`](https://babeljs.io/docs/en/babel-plugin-transform-modules-commonjs#options).
73
+
### `moduleIds`
74
+
75
+
`boolean` defaults to `!!moduleId`
76
+
77
+
Added in: `v7.9.0`
78
+
79
+
Enables module ID generation.
80
+
81
+
### `moduleId`
82
+
83
+
`string`
84
+
85
+
Added in: `v7.9.0`
86
+
87
+
A hard-coded ID to use for the module. Cannot be used alongside `getModuleId`.
88
+
89
+
### `getModuleId`
90
+
91
+
`(name: string) => string`
92
+
93
+
Added in: `v7.9.0`
94
+
95
+
Given the babel-generated module name, return the name to use. Returning
96
+
a falsy value will use the original `name`.
97
+
98
+
### `moduleRoot`
99
+
100
+
`string`
101
+
102
+
Added in: `v7.9.0`
103
+
104
+
A root path to include on generated module names.
105
+
106
+
For options not listed here, see options for [`@babel/plugin-transform-modules-commonjs`](plugin-transform-modules-commonjs.md#options).
See options for [`@babel/plugin-transform-modules-commonjs`](https://babeljs.io/docs/en/babel-plugin-transform-modules-commonjs#options).
238
+
### `moduleIds`
239
+
240
+
`boolean` defaults to `!!moduleId`
241
+
242
+
Added in: `v7.9.0`
243
+
244
+
Enables module ID generation.
245
+
246
+
### `moduleId`
247
+
248
+
`string`
249
+
250
+
Added in: `v7.9.0`
251
+
252
+
A hard-coded ID to use for the module. Cannot be used alongside `getModuleId`.
253
+
254
+
### `getModuleId`
255
+
256
+
`(name: string) => string`
257
+
258
+
Added in: `v7.9.0`
259
+
260
+
Given the babel-generated module name, return the name to use. Returning
261
+
a falsy value will use the original `name`.
262
+
263
+
### `moduleRoot`
264
+
265
+
`string`
266
+
267
+
Added in: `v7.9.0`
268
+
269
+
A root path to include on generated module names.
270
+
271
+
For options not listed here, see options for [`@babel/plugin-transform-modules-commonjs`](plugin-transform-modules-commonjs.md#options).
Copy file name to clipboardExpand all lines: docs/plugin-transform-typescript.md
-7Lines changed: 0 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -257,13 +257,6 @@ Because there are features of the TypeScript language which rely on the full typ
257
257
258
258
1. Since Babel does not type-check, code which is syntactically correct, but would fail the TypeScript type-checking may successfully get transformed, and often in unexpected or invalid ways.
259
259
260
-
1. This plugin does not support [`export =`][exin] and [`import =`][exin], because those cannot be compiled to ES.next. These are a TypeScript only form of `import`/`export`.
261
-
262
-
**Workarounds**:
263
-
264
-
- Use the plugin [babel-plugin-replace-ts-export-assignment](https://www.npmjs.com/package/babel-plugin-replace-ts-export-assignment) to transform `export =`.
265
-
- Convert to using `export default` and `export const`, and `import x, {y} from "z"`.
266
-
267
260
1. Changes to your `tsconfig.json` are not reflected in babel. The build process will always behave as though [`isolatedModules`][iso-mods] is turned on, there are Babel-native alternative ways to set a lot of the [`tsconfig.json` options](#typescript-compiler-options) however.
268
261
269
262
1.**Q**: Why doesn't Babel allow export of a `var` or `let`?
0 commit comments