#use custom-elements / web component lib in Nuxt 3

1 messages · Page 1 of 1 (latest)

sour acorn
#

Hi there,
i need some help. For my customer i need to use its custom-element / web component library in nuxt:
https://component-library.fe.union-investment.de/latest/union-investment/union-investment.esm.js

I got it running, BUT i get vue warnings on the console:

Failed to resolve component: ui-headline If this is a native custom element, make sure to exclude it from component resolution via compilerOptions.isCustomElement

How can i do that in Nuxt 3? For a set of components, which all prefix with ui-

I really appreciate if someone can help me with this!

sour acorn
#

For those who might run into the same problem, I managed to solve this by adding the following to my nuxt config:

vite: {
vue: {
template: {
compilerOptions: {
// treat all tags with a 'ui-' prefix as custom elements
isCustomElement: (tag) => tag.includes('ui-')
}
}
},
},