vite-plugin-vue-auto-name
A Vite plugin to automatically generate file names for Vue components
407
2
| Install | |
|---|---|
npm install vite-plugin-vue-auto-name |
|
| Latest Version: | 0.0.4 |
| License: | MIT |
| Last Updated: | Apr 10, 2022 |
| Links: | GitHub · npm |
Maintainer: philadelphia
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
]
})
Related Packages
vite-plugin-git-revision
Vite plugin that generates VERSION and COMMITHASH files during build based on a...
21,961
11
vite-plugin-resolve-extension-vue
A temporary workaround for issue No loader is configured for ".vue"
6,993
5
Version History
| Version | Released | License |
|---|---|---|
| 0.0.4 | MIT | |
| 0.0.3 | MIT | |
| 0.0.2 | MIT | |
| 0.0.1 | MIT |