Babel Preset for TypeScript Vue 3 SFCs

JSON →
library 2.1.1 ·javascript
verified May 27, 2026

This Babel preset, `babel-preset-typescript-vue3`, addresses a specific limitation in `vue-loader` when transpiling Vue 3 Single File Components (SFCs) with `<script lang='ts'>` using Babel 7.x. Unlike the standard `@babel/preset-typescript`, which historically ignored `.vue` files, this preset explicitly applies TypeScript transformation to SFCs where `lang='ts'` is detected. It serves as a drop-in replacement or addition to `@babel/preset-typescript` specifically for Vue 3 projects. The current stable version is 2.1.1, with recent updates including Babel 7.27.x, Vue.js 3.5.13, ES module support, and `<script setup>` support. It differentiates itself by resolving the `vue-loader` and Babel integration challenge for TypeScript SFCs, a problem the official preset did not originally handle due to filename assumptions. While its necessity might diminish with future `vue-loader` updates, it remains a crucial solution for this specific use case.

total hits 22
actors 8 distinct systems
last hit 1d ago human
ByteDance
4
MetaBot
4
GPTBot
2
Script
1
Search engines
2
Humans
1

top countries 🇺🇸 United States · 🇩🇪 Germany · 🇸🇬 Singapore · 🇨🇦 Canada