This is how you ignore custom elements in Vue 3 and Vite:
// vite.config.js
import vue from '@vitejs/plugin-vue'
export default {
plugins: [vue({
template: {
compilerOptions: {
// i am ignorning my custom '<container>' tag
isCustomElement: (tag) => ['container'].includes(tag)
}
}
})]
}
As mentioned on this github vite issue:
https://github.com/vitejs/vite/issues/1312
Error you will see before implementing this:
[Vue warn]: Failed to resolve component: container
If this is a native custom element, make sure to exclude it from component resolution via compilerOptions.isCustomElement.
Top comments (1)
Thanks!