Skip to content

Commit 114a8d2

Browse files
authored
Merge pull request #3 from coderdiaz/feature/next
feature/next: Added support for build plugin
2 parents a6971e7 + dd725ab commit 114a8d2

14 files changed

+352
-9647
lines changed

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ import 'vue-status-indicator/styles.css'
5050
Import component `status-indicator`.
5151

5252
```javascript
53-
import StatusIndicator from 'vue-status-indicator'
53+
import { StatusIndicator } from 'vue-status-indicator'
5454
```
5555

5656
HTML/Vue:
@@ -60,7 +60,7 @@ HTML/Vue:
6060
<status-indicator active pulse></status-indicator>
6161
</template>
6262
<script>
63-
import StatusIndicator from 'vue-status-indicator'
63+
import { StatusIndicator } from 'vue-status-indicator'
6464
export default {
6565
components: {
6666
StatusIndicator

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+
}

dist/build.js

-1
This file was deleted.

dist/build.js.map

-1
This file was deleted.

dist/vue-status-indicator.esm.js

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/vue-status-indicator.min.js

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/vue-status-indicator.umd.js

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@
66
</head>
77
<body>
88
<div id="app"></div>
9-
<script src="dist/build.js"></script>
9+
<script src="public/dist/build.js"></script>
1010
</body>
1111
</html>

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)