I Can Use web-components that generated by Vue-CLI 3 build command (vue-cli-service build --target wc --name foo ./src/App.vue) as a stand-alone
component in a webpage like this:
<script src="https://unpkg.com/vue"></script>
<script src="./foo.js"></script>
<foo></foo>
BUT When I import this component inside another Vue project:
import Vue from 'vue'
import foo from 'foo'
I get this Error:
Uncaught ReferenceError: Vue is not defined
The Vue CLI 3 documentation says that:
In web component mode, Vue is externalized. This means the bundle will not bundle Vue even if your code imports Vue. The bundle will assume Vue is available on the host page as a global variable.
But it doesn't say that how to fix this problem when you want to use web-components inside another project.
Do you have any Idea?