1
0

vite.config.ts 896 B

12345678910111213141516171819202122232425262728293031323334353637383940
  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. // https://vitejs.dev/config/
  9. export default defineConfig({
  10. plugins: [
  11. glsl(),
  12. vue({
  13. template: {
  14. compilerOptions: {
  15. isCustomElement: tag => (tag.startsWith('Tres') && tag !== 'TresCanvas') || tag === 'primitive',
  16. },
  17. },
  18. }),
  19. AutoImport({
  20. dts: true,
  21. eslintrc: {
  22. enabled: true, // <-- this
  23. },
  24. imports: ['vue'],
  25. }),
  26. Components({
  27. /* options */
  28. }),
  29. UnoCSS({
  30. /* options */
  31. }),
  32. ],
  33. resolve: {
  34. alias: {
  35. '/@': resolve(__dirname, '../src'),
  36. },
  37. dedupe: ['@tresjs/core', 'three'],
  38. },
  39. })