2.1.1 • Published 10 months ago

unplugin-vue-sfcmore v2.1.1

Weekly downloads
-
License
MIT
Repository
-
Last release
10 months ago

unplugin-vue-sfcmore

create Additional information in .vue and output to bundle

now only tested in vite

quick-start

import { sfc } from 'unplugin-vue-sfcmore/vite'
export default {
  plugins: [sfc()], // work both in dev and prod
}

create App.vue and add custom tag

<template>
  ...
</template>

<docs lang="md">
## info
</docs>

in dev mode:

// ...
export function addon() {
  const ret = {}
  ret.docs = '##info'
  return ret
}

in prod mode

// in App.js
// ...
export async function addon() {
  return (await import('./App.addon.js')).default()
}
// in App.addon.js
export default function () {
  const ret = {}
  ret.docs = '##info'

  return ret
}

extension

you can create rule for custom tag

default extensions includes docs, server, props, info

// docs extension
export const Docs = {
  tag: 'docs',
  transformer: (code: string) => {
    return `${JSON.stringify(code)}`
  },
}
2.1.1

10 months ago

2.1.0

10 months ago

1.1.1

1 year ago

1.1.0

1 year ago

1.1.7

12 months ago

1.1.6

1 year ago

1.1.5

1 year ago

1.1.4

1 year ago

1.1.3

1 year ago

1.1.2

1 year ago

2.0.0

12 months ago

1.0.2

1 year ago

1.0.0

1 year ago