Bundle Vue library with Bili

Create a Vue plugin

mkdir my-component && cd my-component
yarn init -y
yarn add bili --dev
export default Vue => {
Vue.component('my-component', {
render: h => h('h2', null, ['hello bili'])
})
}
import Component from './MyComponent.vue'
export default Vue => Vue.component(Component.name, Component)
<template>
<h1>hello</h1>
</template>
<script>
export default {
name: 'my-component'
}
</script>
<!-- let's add some style too :) -->
<style scoped>
h1 {
color: red
}
</style>
yarn add rollup-plugin-vue vue-template-compiler --dev
yarn bili index.js --plugin vue

Bundle in multiple formats

yarn bili index.js --plugin vue --format cjs,umd --moduleName MyComponent

Wrapping Up

--

--

I am GOD’S CHILD.

Love podcasts or audiobooks? Learn on the go with our new app.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store