vite.config.ts 869 B

123456789101112131415161718192021222324252627282930313233343536
  1. import { defineConfig } from 'vite'
  2. import uni from '@dcloudio/vite-plugin-uni'
  3. import path from 'path'
  4. // https://vitejs.dev/config/
  5. export default defineConfig({
  6. plugins: [uni()],
  7. server: {
  8. host: '0.0.0.0',
  9. port: 5173,
  10. },
  11. resolve: {
  12. alias: {
  13. '@': path.resolve(__dirname, 'src'),
  14. '@components': path.resolve(__dirname, 'src/components'),
  15. '@stores': path.resolve(__dirname, 'src/stores'),
  16. '@utils': path.resolve(__dirname, 'src/utils'),
  17. '@mock': path.resolve(__dirname, 'src/mock'),
  18. '@styles': path.resolve(__dirname, 'src/styles')
  19. }
  20. },
  21. css: {
  22. postcss: {
  23. plugins: [
  24. require('tailwindcss'),
  25. require('autoprefixer'),
  26. ]
  27. },
  28. preprocessorOptions: {
  29. scss: {
  30. api: 'modern',
  31. additionalData: '@use "@/styles/variables.scss" as *;'
  32. }
  33. }
  34. }
  35. })