unplugin-vue-sfc-name
v0.0.9
Published
Extending the vue script setup syntactic sugar
Downloads
121
Maintainers
Readme
unplugin-vue-sfc-name
Feature
- support name
- support inheritAttrs
- precise breakpoints
- Expanded the function of automatic name generation
Usage
Basic example
<template>
<div>hello world {{ a }}</div>
</template>
<script lang="ts" setup name="App" inheritAttrs="false">
const a = 1
</script>
Install
npm i unplugin-vue-sfc-name
// vite.config.ts
import Starter from 'unplugin-vue-sfc-name/vite'
export default defineConfig({
plugins: [
Starter({ /* options */ }),
],
})
Example: playground/
// rollup.config.js
import Starter from 'unplugin-vue-sfc-name/rollup'
export default {
plugins: [
Starter({ /* options */ }),
],
}
// webpack.config.js
module.exports = {
/* ... */
plugins: [
require('unplugin-vue-sfc-name/webpack')({ /* options */ })
]
}
// nuxt.config.js
export default {
buildModules: [
['unplugin-vue-sfc-name/nuxt', { /* options */ }],
],
}
This module works for both Nuxt 2 and Nuxt Vite
// vue.config.js
module.exports = {
configureWebpack: {
plugins: [
require('unplugin-vue-sfc-name/webpack')({ /* options */ }),
],
},
}
// esbuild.config.js
import { build } from 'esbuild'
import Starter from 'unplugin-vue-sfc-name/esbuild'
build({
plugins: [Starter()],
})