vite.config.ts 949 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. import { defineConfig } from 'vite'
  2. import vue from '@vitejs/plugin-vue'
  3. import { resolve } from 'pathe'
  4. import AutoImport from 'unplugin-auto-import/vite'
  5. import Components from 'unplugin-vue-components/vite'
  6. import glsl from 'vite-plugin-glsl'
  7. import UnoCSS from 'unocss/vite'
  8. import { presetIcons, presetWebFonts } from 'unocss'
  9. // https://vitejs.dev/config/
  10. export default defineConfig({
  11. plugins: [
  12. glsl(),
  13. vue({
  14. template: {
  15. compilerOptions: {
  16. isCustomElement: tag => (tag.startsWith('Tres') && tag !== 'TresCanvas') || tag === 'primitive',
  17. },
  18. },
  19. }),
  20. AutoImport({
  21. dts: true,
  22. eslintrc: {
  23. enabled: true, // <-- this
  24. },
  25. imports: ['vue'],
  26. }),
  27. Components({
  28. /* options */
  29. }),
  30. UnoCSS({
  31. /* options */
  32. }),
  33. ],
  34. resolve: {
  35. alias: {
  36. '/@': resolve(__dirname, '../src'),
  37. },
  38. dedupe: ['@tresjs/core', 'three'],
  39. },
  40. })