vite.config.ts 959 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  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 { templateCompilerOptions } from '@tresjs/core'
  9. import { qrcode } from 'vite-plugin-qrcode'
  10. // https://vitejs.dev/config/
  11. export default defineConfig({
  12. plugins: [
  13. glsl(),
  14. vue({
  15. script: {
  16. propsDestructure: true,
  17. },
  18. ...templateCompilerOptions,
  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. qrcode(), // only applies in dev mode
  34. ],
  35. resolve: {
  36. alias: {
  37. '@tresjs/core': resolve(__dirname, '../src/index.ts'),
  38. },
  39. dedupe: ['three'],
  40. },
  41. })