https://github.com/weijuer/w-rollup-starter-lib-vue
https://github.com/weijuer/w-rollup-starter-lib-vue
Last synced: 4 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/weijuer/w-rollup-starter-lib-vue
- Owner: weijuer
- Created: 2022-10-01T07:01:37.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2022-10-01T07:01:45.000Z (almost 3 years ago)
- Last Synced: 2025-01-12T15:08:32.243Z (6 months ago)
- Language: JavaScript
- Size: 166 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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
# Usagefor 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')
```