Gathering detailed insights and metrics for babel-preset-typescript-vue
Gathering detailed insights and metrics for babel-preset-typescript-vue
Gathering detailed insights and metrics for babel-preset-typescript-vue
Gathering detailed insights and metrics for babel-preset-typescript-vue
TypeScript preset for Babel 7.x supporting Vue.js components written in TS
npm install babel-preset-typescript-vue
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
22 Stars
40 Commits
5 Forks
2 Watching
15 Branches
2 Contributors
Updated on 19 Jun 2024
JavaScript (77.62%)
Vue (22.38%)
Cumulative downloads
Total Downloads
Last day
-4.7%
8,167
Compared to previous day
Last week
6.3%
41,981
Compared to previous week
Last month
14.7%
185,835
Compared to previous month
Last year
-27.5%
2,283,225
Compared to previous year
TypeScript preset for Babel 7.x supporting Vue.js components written in TS. A drop-in replacement for @babel/preset-typescript.
This preset was created to support TypeScript transpilation using Babel (not Microsoft TypeScript), also for TypeScript-based Vue.js Single File Components (SFC), without enforced TS-to-JS transpilation for all files (which can be achieved by adding @babel/plugin-transform-typescript
to your Babel config).
Due to architectural limitations of vue-loader
the original @babel/preset-typescript preset was always assuming that the <script>
section of Vue SFC was written in JavaScript. This wasn't an issue when webpack
was using different loaders for .js and .ts files. Since Babel unifies that, vue-loader
is always passing this file to babel-loader
with an original filename (and a resourceQuery
which is not accessible from the transpiling preset). Since preset-typescript
was transpiling files with .ts and .tsx extensions, not .vue, SFCs were ignored and reported errors during ES6 to ES5 transpilation.
Most likely in the future, this won't be no longer needed if vue-loader
will consider also Babel transpilation. As for this is the only friendly way to resolve the issue.
This preset checks whether the .vue file (SFC) has a lang="ts"
attribute set for the <script>
tag. If so, @babel/plugin-transform-typescript is applied explicitly to the SFC file.
All the options match the original @babel/preset-typescript preset options.
You can read more about configuring preset options here
See @babel/preset-typescript for more information or the issues associated with the original preset package.
Using npm:
1npm install --save-dev babel-preset-typescript-vue
or using yarn:
1yarn add babel-preset-typescript-vue --dev
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
Found 2/28 approved changesets -- score normalized to 0
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
Reason
security policy file not detected
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
31 existing vulnerabilities detected
Details
Score
Last Scanned on 2024-11-18
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More