I'm using webpack with vuejs and I'm trying to put as much stuff as I can in vendor.js so that my app.js can be smaller so that webpack build time can be reduced.
I'm trying to register Font Awesome vuejs version globally.
in my main.js
import Icon from 'vue-awesome';
window.Icon = Icon;
Vue.use(Icon);
And in my component .vue file I have
<template>
<icon name="beer"></icon>
</template>
<script>
export default {
components: {
Icon: window.Icon
}
}
</script>
And I am getting this error:
Unknown custom element: <icon> - did you register the component correctly?
window.Icon is set correctly I can log it, but i think i am doing some rookie mistake here, because when i include it locally in the component directly everything is working.
icon: window.Iconvue-awesomedocs, shouldn't you import Icon in way like thisimport Icon from 'vue-awesome/components/Icon.vue'?Vue.use()within each module. github.com/vuejs-templates/webpack/issues/63