vite.config.js 514 B

12345678910111213141516171819202122232425
  1. import { defineConfig } from 'vite'
  2. import uni from '@dcloudio/vite-plugin-uni'
  3. import path from 'path'
  4. export default defineConfig({
  5. plugins: [uni()],
  6. resolve: {
  7. alias: {
  8. '@': path.resolve(__dirname, 'src'),
  9. },
  10. extensions: ['.uts', '.ts', '.js', '.json', '.vue', '.uvue']
  11. },
  12. server: {
  13. proxy: {
  14. '/dev': {
  15. target: 'https://dev.xiaodingyun.cn',
  16. changeOrigin: true,
  17. rewrite: (path) => {
  18. console.log('代理路径:', path)
  19. return path.replace(/^\/dev/, '')
  20. }
  21. }
  22. }
  23. }
  24. })