Gathering detailed insights and metrics for babel-preset-proposal-typescript
Gathering detailed insights and metrics for babel-preset-proposal-typescript
Gathering detailed insights and metrics for babel-preset-proposal-typescript
Gathering detailed insights and metrics for babel-preset-proposal-typescript
Yet another Babel preset for TypeScript, only transforms proposals which TypeScript does not support now.
npm install babel-preset-proposal-typescript
Typescript
Module System
Min. Node Version
Node Version
NPM Version
59.4
Supply Chain
79.4
Quality
75.4
Maintenance
100
Vulnerability
99.6
License
TypeScript (84.09%)
JavaScript (15.91%)
Total Downloads
212,434
Last Day
22
Last Week
932
Last Month
4,206
Last Year
55,483
MIT License
26 Stars
121 Commits
2 Forks
2 Watchers
2 Branches
7 Contributors
Updated on Mar 24, 2025
Minified
Minified + Gzipped
Latest Version
4.0.0
Package Id
babel-preset-proposal-typescript@4.0.0
Unpacked Size
27.88 kB
Size
6.38 kB
File Count
14
NPM Version
10.2.3
Node Version
20.10.0
Published on
Dec 16, 2023
Cumulative downloads
Total Downloads
Last Day
-87.6%
22
Compared to previous day
Last Week
-29.6%
932
Compared to previous week
Last Month
-61.1%
4,206
Compared to previous month
Last Year
42.9%
55,483
Compared to previous year
20
2
Yet another Babel preset for TypeScript, only transforms proposals which TypeScript does not support now.
So that you can use babel to transform proposals which are current in stage 0-2 and TypeScript team will not implement them temporarily.
1# yarn 2yarn add -D babel-preset-proposal-typescript 3 4# npm 5npm i -D babel-preset-proposal-typescript
option | description | defaults |
---|---|---|
decoratorsBeforeExport | See Babel Document | undefined |
decoratorsLegacy | Whether to use legacy decorators semantic | true |
importDefer | Whether to enabled import-defer plugin, if true transform-modules-commonjs will be enabled automatically | false |
isTSX | Whether to enable jsx plugin with typescript | false , but true for /\.[jt]sx$/ |
optionalChainingAssignVersion | Version for optional-chaining-assign plugin, only '2023-07' allowed for now | '2023-07' |
pipelineOperator | Implementation of pipeline operator, minimal , smart or fsharp | minimal |
recordTuplePolyfill | Whether to enable import record-tuple plugin and polyfill, or specific the polyfill module name | true for Node>=14.6, it represents @bloomberg/record-tuple-polyfill |
recordTupleSyntaxType | record-tuple syntax, hash or bar | hash |
Note that unlike plugins, the presets are applied in an order of last to first (https://babeljs.io/docs/en/presets/#preset-ordering), so please make sure proposal-typescript
is used at the last.
.babelrc
(Recommended).babelrc
1{ 2 "presets": ["proposal-typescript"] 3}
1babel input.ts --presets proposal-typescript > output.ts
1require('@babel/core').transform('code', { 2 presets: ['proposal-typescript'], 3})
Pipe codes through babel-loader
.
1loader = { 2 test: /\.[jt]sx?$/, 3 loader: 'babel-loader', 4 options: { 5 presets: ['@babel/typescript', 'proposal-typescript'], 6 }, 7} 8 9// if you prefer `ts-loader` or `awesome-typescript-loader` 10loader = { 11 test: /\.tsx?$/, 12 use: [ 13 { 14 loader: 'ts-loader', 15 }, 16 { 17 loader: 'babel-loader', 18 options: { 19 presets: ['proposal-typescript'], 20 }, 21 }, 22 ], 23}
1stG | RxTS | UnTS |
---|---|---|
1stG | RxTS | UnTS |
---|---|---|
Detailed changes for each release are documented in CHANGELOG.md.
No vulnerabilities found.
No security vulnerabilities found.