Gathering detailed insights and metrics for babel-preset-typescript-vue3
Gathering detailed insights and metrics for babel-preset-typescript-vue3
Gathering detailed insights and metrics for babel-preset-typescript-vue3
Gathering detailed insights and metrics for babel-preset-typescript-vue3
npm install babel-preset-typescript-vue3
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
5 Stars
87 Commits
1 Watching
9 Branches
3 Contributors
Updated on 20 Aug 2023
JavaScript (71.25%)
Vue (28.75%)
Cumulative downloads
Total Downloads
Last day
-29.7%
640
Compared to previous day
Last week
-13.9%
3,838
Compared to previous week
Last month
16.9%
16,787
Compared to previous month
Last year
-7.6%
184,925
Compared to previous year
TypeScript preset for Babel 7.x supporting Vue.js 3 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 Support for Vue.js 3, 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-vue3
or using yarn:
1yarn add babel-preset-typescript-vue3 --dev
This package is originated from babel-preset-typescript-vue by pawelgabryelewicz and revised to meet the Vue.js 3 requirements using @vue/compiler-sfc, and following tests.
1module: { 2 rules: [ 3 { 4 test: /\.vue$/, 5 loader: "vue-loader", 6 }, 7 { 8 test: /\.(j|t)sx?$/, 9 exclude: /node_modules/, 10 use: { 11 loader: "babel-loader", 12 options: { 13 presets: [ 14 "@babel/preset-env", 15 "babel-preset-typescript-vue3", 16 "@babel/preset-typescript", 17 ], 18 }, 19 }, 20 }, 21 ... 22 ] 23}
v2.0.16 - Update Dependencies v2.0.14 - Update Dependencies v2.0.11 - Supports <script setup> (Link) v2.0.8 - Update Dependencies (vue@3.0.3 -> vue@3.0.5)
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
Found 0/10 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
security policy file not detected
Details
Reason
project is not fuzzed
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
19 existing vulnerabilities detected
Details
Score
Last Scanned on 2024-11-25
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