vite-ssg icon indicating copy to clipboard operation
vite-ssg copied to clipboard

Add compilerOptions.isCustomElement

Open ausgomez opened this issue 2 years ago • 1 comments

Hi, I am trying to use a custom native element, but I cannot find a way to ignore from the list of components

Here is the warning I am getting: Failed to resolve component: model-viewer If this is a native custom element, make sure to exclude it from component resolution via compilerOptions.isCustomElement.

ausgomez avatar Oct 11 '21 18:10 ausgomez

// src/main.ts
export const createApp = ViteSSG(
  App,
  { routes },
  ({ app, router, routes, isClient, initialState }) => {
 
    app.config.compilerOptions.isCustomElement = tag => tag.startsWith('model-viewer')

  }
)

Or you can try passing compiler options to vite plugin: https://github.com/vitejs/vite/tree/main/packages/plugin-vue#example-for-passing-options-to-vuecompiler-dom

sibbng avatar Oct 11 '21 21:10 sibbng