vite.config.ts 793 B

123456789101112131415161718192021222324252627282930313233
  1. import path from 'path'
  2. import { defineConfig } from 'vite'
  3. import vue from '@vitejs/plugin-vue'
  4. import legacy from '@vitejs/plugin-legacy'
  5. // https://vitejs.dev/config/
  6. export default defineConfig(({ command }) => ({
  7. plugins: [vue(), command === 'build' && legacy()].filter(Boolean),
  8. resolve: {
  9. alias: {
  10. '@': path.join(__dirname, 'src'),
  11. '@img': path.join(__dirname, 'src/assets'),
  12. },
  13. },
  14. css: {
  15. preprocessorOptions: {
  16. scss: {
  17. additionalData:
  18. '@import "@/style/_variables.scss", "@/style/_mixins.scss";',
  19. },
  20. },
  21. },
  22. base: '/ptc/',
  23. server: {
  24. proxy: {
  25. '/api/': {
  26. target: 'http://t.ptcrepair.com.au',
  27. changeOrigin: true,
  28. rewrite: path => path.replace(/^\/api/, ''),
  29. },
  30. },
  31. },
  32. }))