antfu-collective / vite-ssg

Static site generation for Vue 3 on Vite
MIT License
1.34k stars 137 forks source link

Add compilerOptions.isCustomElement #115

Open ausgomez opened 3 years ago

ausgomez commented 3 years ago

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.

sibbng commented 3 years ago
// 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