Skip to content

feature/next: Added support for build plugin #3

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
May 5, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ import 'vue-status-indicator/styles.css'
Import component `status-indicator`.

```javascript
import StatusIndicator from 'vue-status-indicator'
import { StatusIndicator } from 'vue-status-indicator'
```

HTML/Vue:
Expand All @@ -60,7 +60,7 @@ HTML/Vue:
<status-indicator active pulse></status-indicator>
</template>
<script>
import StatusIndicator from 'vue-status-indicator'
import { StatusIndicator } from 'vue-status-indicator'
export default {
components: {
StatusIndicator
Expand Down
19 changes: 19 additions & 0 deletions build/rollup.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import vue from 'rollup-plugin-vue'
import buble from 'rollup-plugin-buble'
import uglify from 'rollup-plugin-uglify-es'

export default {
input: 'index.js',
output: {
name: 'VueStatusIndicator',
exports: 'named'
},
plugins: [
vue({
css: true,
compileTemplate: true
}),
buble(),
uglify()
]
}
1 change: 0 additions & 1 deletion dist/build.js

This file was deleted.

1 change: 0 additions & 1 deletion dist/build.js.map

This file was deleted.

1 change: 1 addition & 0 deletions dist/vue-status-indicator.esm.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions dist/vue-status-indicator.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions dist/vue-status-indicator.umd.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
</head>
<body>
<div id="app"></div>
<script src="dist/build.js"></script>
<script src="public/dist/build.js"></script>
</body>
</html>
25 changes: 25 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import StatusIndicator from './src/components/StatusIndicator.vue'

export function install (Vue) {
if (install.installed) return
install.installed = true
Vue.component('StatusIndicator', StatusIndicator)
}

const plugin = {
install
}

let GlobalVue = null
if (typeof window !== 'undefined') {
GlobalVue = window.Vue
} else if (typeof global !== 'undefined') {
GlobalVue = global.Vue
}

if (GlobalVue) {
GlobalVue.use(plugin)
}

export { StatusIndicator }
export default plugin
Loading