vite.config.ts 835 B

1234567891011121314151617181920212223242526272829303132
  1. import { defineConfig } from 'vite'
  2. import Unocss from 'unocss/vite'
  3. import svgLoader from 'vite-svg-loader'
  4. import Components from 'unplugin-vue-components/vite'
  5. const whitelist = [
  6. 'TresCanvas',
  7. 'TresLeches',
  8. 'TresScene',
  9. ]
  10. export default defineConfig({
  11. plugins: [
  12. svgLoader(),
  13. Unocss(),
  14. Components({
  15. // allow auto load markdown components under `.vitepress/theme/components`
  16. dirs: ['.vitepress/theme/components'],
  17. extensions: ['vue', 'md'],
  18. // allow auto import and register components used in markdown
  19. include: [/\.vue$/, /\.vue\?vue/, /\.md$/],
  20. dts: 'components.d.ts',
  21. }),
  22. ],
  23. vue: {
  24. template: {
  25. compilerOptions: {
  26. isCustomElement: (tag: string) => tag.startsWith('Tres') && !whitelist.includes(tag) || tag === 'primitive',
  27. },
  28. },
  29. }
  30. })