Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/weijuer/w-rollup-starter-lib-vue


https://github.com/weijuer/w-rollup-starter-lib-vue

Last synced: 9 days ago
JSON representation

Awesome Lists containing this project

README

        

# w-rollup-starter-lib-vue
This repo contains a bare-bones example of how to create a vue base UI library using Rollup, including importing a module from `node_modules` and converting it from CommonJS.

# devDependencies info
- JSON
- @rollup/plugin-json
- CSS
- rollup-plugin-postcss
- postcss
- autoprefixer
- cssnano
- less
- Vue
- rollup-plugin-vue
- @vue/compiler-sfc

# Usage

for umd

```html



myLib







// umd
const { createApp } = Vue;
const app = createApp();
console.log('myLib', myLib)

app.use(myLib);
app.mount('#app');

```

for esm

```js
// esm
import { createApp } from 'vue'
import myLib from 'w-rollup-starter-lib-vue'
import 'w-rollup-starter-lib-vue/dist/index.css'

createApp().use(myLib).mount('#app')
```