Skip to content

Commit 006db9a

Browse files
committed
Added config for compile plugin
1 parent fcae23e commit 006db9a

File tree

2 files changed

+44
-0
lines changed

2 files changed

+44
-0
lines changed

build/rollup.config.js

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import vue from 'rollup-plugin-vue'
2+
import buble from 'rollup-plugin-buble'
3+
import uglify from 'rollup-plugin-uglify-es'
4+
5+
export default {
6+
input: 'index.js',
7+
output: {
8+
name: 'VueStatusIndicator',
9+
exports: 'named'
10+
},
11+
plugins: [
12+
vue({
13+
css: true,
14+
compileTemplate: true
15+
}),
16+
buble(),
17+
uglify()
18+
]
19+
}

index.js

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import StatusIndicator from './src/components/StatusIndicator.vue'
2+
3+
export function install (Vue) {
4+
if (install.installed) return
5+
install.installed = true
6+
Vue.component('StatusIndicator', StatusIndicator)
7+
}
8+
9+
const plugin = {
10+
install
11+
}
12+
13+
let GlobalVue = null
14+
if (typeof window !== 'undefined') {
15+
GlobalVue = window.Vue
16+
} else if (typeof global !== 'undefined') {
17+
GlobalVue = global.Vue
18+
}
19+
20+
if (GlobalVue) {
21+
GlobalVue.use(plugin)
22+
}
23+
24+
export { StatusIndicator }
25+
export default plugin

0 commit comments

Comments
 (0)