Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/wobsoriano/vue-sfc-unbuild
Quickly generate redistributable Vue components with Unbuild.
https://github.com/wobsoriano/vue-sfc-unbuild
rollup sfc unbuild vite vue
Last synced: 7 days ago
JSON representation
Quickly generate redistributable Vue components with Unbuild.
- Host: GitHub
- URL: https://github.com/wobsoriano/vue-sfc-unbuild
- Owner: wobsoriano
- License: mit
- Created: 2022-12-30T04:44:34.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-11-02T19:03:25.000Z (about 2 months ago)
- Last Synced: 2024-11-26T05:51:49.269Z (about 1 month ago)
- Topics: rollup, sfc, unbuild, vite, vue
- Language: Vue
- Homepage:
- Size: 895 KB
- Stars: 48
- Watchers: 2
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# vue-sfc-unbuild
Bundleless Vue 2/3 component library starter.
Features:
- Build with [unbuild](https://github.com/unjs/unbuild)
- File-to-file transpilation via [mkdist](https://github.com/unjs/mkdist)
- Playground with [vite](https://vitejs.dev/)
- Sample SFC to kick-start development## Generate a project
Vue 3
```bash
npx degit wobsoriano/vue-sfc-unbuild library-name
```Vue 2
```bash
npx degit wobsoriano/vue-sfc-unbuild#vue2 library-name
```## Setup
```bash
# 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)
```ts
// src/main.tsimport { 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
```vue
import { Button, Card } from 'my-library/components'
```
## License
MIT