Skip to content
/ vue-sfc-unbuild Public template

Quickly generate redistributable Vue components with Unbuild.

License

Notifications You must be signed in to change notification settings

wobsoriano/vue-sfc-unbuild

Repository files navigation

vue-sfc-unbuild

Bundleless Vue 2/3 component library starter.

Features:

  • Build with unbuild
  • File-to-file transpilation via mkdist
  • Playground with vite
  • Sample SFC to kick-start development

Generate a project

Vue 3

npx degit wobsoriano/vue-sfc-unbuild library-name

Vue 2

npx degit wobsoriano/vue-sfc-unbuild#vue2 library-name

Setup

# install dependencies
npm install

# start the dev app with hot reload, great for testing components
npm run dev

# build the library, available under dist
npm run build

# build the dev app, available under dev/dist
npm run dev:build

# preview the dev app locally from dev/dist
npm run dev:preview

Usage

Install all components (as a plugin)

// src/main.ts

import { createApp } from 'vue'
import MyLibrary from 'my-library'

import App from './App.vue'

const app = createApp(App)
app.use(MyLibrary)
app.mount('#app')

Import some components

<script setup lang="ts">
import { Button, Card } from 'my-library/components'
</script>

License

MIT

About

Quickly generate redistributable Vue components with Unbuild.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published