I am using Vue-Cookies to set a cookie in a vue component before redirecting to another webapp (the cookie is used in that webapp). I also build the vue component as a web component with the “–target wc” command for inclusion in other 3rd part projects. The component works fine when building the project, but the web component version throws this error on compile:
TypeError: Cannot read property 'set' of undefined
I can force it to work by including
<script src="https://email@example.com/vue-cookies.js"></script> in the head of the HTML document I am using to test the web component for function.
Is there a way I can build this call into the web component so third parties don’t have to include this script tag to make it work?