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

0.0.4 • Public • Published

Background

Solve the name property missing after bundled.

When using this, you don't need to provide the name property manually anymore

for example /foo/bar/YourComponent.vue:

<script setup>
// ... some scripts
</script>
<template>
  <!-- ... some dom -->
</template>

will be bundled into something like this:

const _sfc_main = /* @__PURE__ */ _defineComponent({
  name: "YourComponent",
  // ... Your code
})

Install

npm install -D vite-plugin-vue-auto-name
yarn add -D vite-plugin-vue-auto-name
pnpm add -D vite-plugin-vue-auto-name

Usage

// vite.config.js
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import vitePluginVueAutoName from 'vite-plugin-vue-auto-name'

export default defineConfig({
  plugins: [
    vue(), 
    vitePluginVueAutoName(),
    // ...other plugins
  ]
})

Readme

Keywords

Package Sidebar

Install

npm i vite-plugin-vue-auto-name

Weekly Downloads

1

Version

0.0.4

License

MIT

Unpacked Size

4.17 kB

Total Files

5

Last publish

Collaborators

  • philadelphia