vite-plugin-vue-component-name
TypeScript icon, indicating that this package has built-in type declarations

0.0.3 • Public • Published

vite-plugin-vue-component-name

NPM version

Features

  • [x] Make the vue script syntax support the name attribute
  • [x] Make the vue script setup syntax support the name attribute
  • [x] Allow the vue script syntax with empty content support the name attribute
  • [x] Use file path generate name attribute

Install

node version: >=12.0.0 vite version: >=2.0.0

pnpm i vite-plugin-vue-component-name -D

or

npm i vite-plugin-vue-component-name -D

or

yarn add vite-plugin-vue-component-name -D

Usage

  • Config plugin in vite.config.ts. In this way, the required functions can be introduced as needed
import { Plugin, defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import vueComponentName from 'vite-plugin-vue-component-name'

export default defineConfig({
  plugins: [vue(), vueComponentName()],
})
  • SFC
<script lang="ts" setup name="App"></script>

<template>
  <div>hello world</div>
</template>

Thanks

License

MIT License © 2023 tttxdxd

Package Sidebar

Install

npm i vite-plugin-vue-component-name

Weekly Downloads

2

Version

0.0.3

License

MIT

Unpacked Size

11.6 kB

Total Files

6

Last publish

Collaborators

  • tttxdxd