Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
babel-preset-typescript-vue
Advanced tools
TypeScript preset for Babel 7.x supporting Vue.js components written in TS
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:
npm install --save-dev babel-preset-typescript-vue
or using yarn:
yarn add babel-preset-typescript-vue --dev
FAQs
TypeScript preset for Babel 7.x supporting Vue.js components written in TS
The npm package babel-preset-typescript-vue receives a total of 34,172 weekly downloads. As such, babel-preset-typescript-vue popularity was classified as popular.
We found that babel-preset-typescript-vue demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.