vite.config.ts 980 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  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. script: {
  14. propsDestructure: true,
  15. },
  16. template: {
  17. compilerOptions: {
  18. isCustomElement: tag => (tag.startsWith('Tres') && tag !== 'TresCanvas' && tag !== 'TresLeches') || tag === 'primitive',
  19. },
  20. },
  21. }),
  22. AutoImport({
  23. dts: true,
  24. eslintrc: {
  25. enabled: true, // <-- this
  26. },
  27. imports: ['vue'],
  28. }),
  29. Components({
  30. /* options */
  31. }),
  32. UnoCSS({
  33. /* options */
  34. }),
  35. ],
  36. resolve: {
  37. alias: {
  38. '@tresjs/core': resolve(__dirname, '../src/index.ts'),
  39. },
  40. dedupe: ['three'],
  41. },
  42. })