You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

26 lines
626 B

1 month ago
1 month ago
1 month ago
4 weeks ago
1 month ago
  1. import { defineConfig } from 'vite'
  2. import vue from '@vitejs/plugin-vue'
  3. import { resolve } from 'path' //
  4. export default defineConfig({
  5. plugins: [vue()], //
  6. server: {
  7. host: '192.168.1.102',
  8. port: 5173,
  9. // 错误1:server 块内不能嵌套 plugins 配置(已删除)
  10. proxy: {
  11. '/api': {
  12. target: 'http://192.168.99.223:3000',
  13. changeOrigin: true,
  14. rewrite: (path) => path.replace(/^\/api/, '')
  15. }
  16. }
  17. },
  18. resolve: { //
  19. alias: {
  20. "/@": resolve(__dirname, "src"), //
  21. }
  22. },
  23. base: process.env.NODE_ENV === "production" ? "/dazhuanpan" : "/",
  24. })