Socket
Socket
Sign inDemoInstall

@vue/cli-plugin-typescript

Package Overview
Dependencies
Maintainers
3
Versions
158
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@vue/cli-plugin-typescript

typescript plugin for vue-cli


Version published
Weekly downloads
187K
decreased by-20.86%
Maintainers
3
Weekly downloads
 
Created

What is @vue/cli-plugin-typescript?

@vue/cli-plugin-typescript is a Vue CLI plugin that adds TypeScript support to Vue.js projects. It allows developers to write Vue components and other code in TypeScript, providing type safety and other benefits of TypeScript.

What are @vue/cli-plugin-typescript's main functionalities?

TypeScript Support

This feature allows you to add TypeScript support to your Vue.js project. By including the plugin in your Vue CLI configuration, you can start writing your Vue components and other code in TypeScript.

module.exports = {
  plugins: [
    '@vue/cli-plugin-typescript'
  ]
};

TypeScript Configuration

This feature provides a default TypeScript configuration file (tsconfig.json) that is optimized for Vue.js projects. It includes settings for module resolution, strict type checking, and paths for resolving modules.

{
  "compilerOptions": {
    "target": "esnext",
    "module": "esnext",
    "strict": true,
    "jsx": "preserve",
    "importHelpers": true,
    "moduleResolution": "node",
    "experimentalDecorators": true,
    "esModuleInterop": true,
    "allowSyntheticDefaultImports": true,
    "sourceMap": true,
    "baseUrl": ".",
    "types": [
      "webpack-env"
    ],
    "paths": {
      "@/*": [
        "src/*"
      ]
    },
    "lib": [
      "esnext",
      "dom",
      "dom.iterable",
      "scripthost"
    ]
  },
  "include": [
    "src/**/*.ts",
    "src/**/*.tsx",
    "src/**/*.vue"
  ],
  "exclude": [
    "node_modules"
  ]
}

TypeScript in Vue Components

This feature allows you to write Vue components using TypeScript. By setting the script tag's lang attribute to 'ts', you can leverage TypeScript's type checking and other features within your Vue components.

<template>
  <div class="hello">
    <h1>{{ msg }}</h1>
  </div>
</template>

<script lang="ts">
import { defineComponent } from 'vue';

export default defineComponent({
  name: 'HelloWorld',
  props: {
    msg: String
  }
});
</script>

<style scoped>
h1 {
  color: #42b983;
}
</style>

Other packages similar to @vue/cli-plugin-typescript

Keywords

FAQs

Package last updated on 23 Mar 2022

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc