unplugin-vue-sfc-name
TypeScript icon, indicating that this package has built-in type declarations

0.0.9 • Public • Published

unplugin-vue-sfc-name

NPM version

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
// vite.config.ts
import Starter from 'unplugin-vue-sfc-name/vite'
export default defineConfig({
  plugins: [
    Starter({ /* options */ }),
  ],
})

Example: playground/


Rollup
// rollup.config.js
import Starter from 'unplugin-vue-sfc-name/rollup'
export default {
  plugins: [
    Starter({ /* options */ }),
  ],
}


Webpack
// webpack.config.js
module.exports = {
  /* ... */
  plugins: [
    require('unplugin-vue-sfc-name/webpack')({ /* options */ })
  ]
}


Nuxt
// nuxt.config.js
export default {
  buildModules: [
    ['unplugin-vue-sfc-name/nuxt', { /* options */ }],
  ],
}

This module works for both Nuxt 2 and Nuxt Vite

Vue CLI
// vue.config.js
module.exports = {
  configureWebpack: {
    plugins: [
      require('unplugin-vue-sfc-name/webpack')({ /* options */ }),
    ],
  },
}


esbuild
// esbuild.config.js
import { build } from 'esbuild'
import Starter from 'unplugin-vue-sfc-name/esbuild'
build({
  plugins: [Starter()],
})


Package Sidebar

Install

npm i unplugin-vue-sfc-name

Weekly Downloads

29

Version

0.0.9

License

MIT

Unpacked Size

37 kB

Total Files

26

Last publish

Collaborators

  • elonehoo