Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation for vueCompilerOptions on Vite 2 #1312

Closed
ais-one opened this issue Jan 3, 2021 · 2 comments
Closed

Documentation for vueCompilerOptions on Vite 2 #1312

ais-one opened this issue Jan 3, 2021 · 2 comments
Labels
documentation Improvements or additions to documentation

Comments

@ais-one
Copy link
Contributor

ais-one commented Jan 3, 2021

How do we use vueCompilerOptions in Vite 2 vite.config.js file?

Is it configured in the vue plugin? And how so?

An example would be using the following properties isCustomElement

@underfin
Copy link
Member

underfin commented Jan 3, 2021

You can use like below example. For types fix, i pull request here #1316

 // vite.config.js
import vue from '@vitejs/plugin-vue'

export default {
  plugins: [vue({
    template: {
      compilerOptions: {
        isCustomElement: () => true
      }
    }
  })]
}

@underfin underfin added the documentation Improvements or additions to documentation label Jan 3, 2021
@ais-one
Copy link
Contributor Author

ais-one commented Jan 3, 2021

    template: {
      compilerOptions: {
        isCustomElement: () => true
      }
    }

Yes it works well.

    ...
    vue({
      template: {
        compilerOptions: {
          isCustomElement: tag => tag.startsWith('vaadin-') // vaadin web components
            || tag.startsWith('mwc-') // material web components
            || tag.startsWith('sl-') // shoelace web components
        }
      }
    })
    ...

Hopefully it can be added to one of the markdown files in the project or to the ViteJS documenation

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

2 participants