nuxt.config.js 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. export default defineNuxtConfig({
  2. taget: "static",
  3. compatibilityDate: '2024-04-03',
  4. devtools: { enabled: true },
  5. module: [
  6. '@nuxtjs/style-resources',
  7. '@element-plus/nuxt',
  8. "@gauseen/nuxt-proxy",
  9. '@pinia/nuxt',
  10. ],
  11. css: [
  12. '~/assets/css/global.css',
  13. '~/assets/css/font.css',
  14. 'element-plus/dist/index.css',
  15. 'element-plus/theme-chalk/display.css'
  16. ],
  17. router: {
  18. // middleware: ['auth']
  19. mode: 'hash'
  20. },
  21. build: {
  22. publicPath: '/'
  23. },
  24. nitro: {
  25. output: {
  26. publicDir: "dist",
  27. staticDir: "static"
  28. }
  29. },
  30. server: {
  31. port: 3000,
  32. host: 'localhost'
  33. },
  34. plugins: [
  35. '@/plugins/element-plus',
  36. {
  37. src: '@/plugins/request',
  38. mode: 'client'
  39. }
  40. ],
  41. buildModules: [
  42. 'nuxt-vite'
  43. ],
  44. proxyTable: {
  45. // 代理
  46. "/test": {
  47. target: "http://192.168.1.114:9501",//测试服务器
  48. // target: "http://192.168.1.117:9501",//测试服务器
  49. // target: "http://192.168.x.xxx:8008",//xxx
  50. changeOrigin: true,
  51. pathRewrite: {
  52. "^/test": ""
  53. }
  54. },
  55. "/mock": {
  56. target: 'http://192.168.1.114:9501',
  57. // target: "http://192.168.1.117:9501",//测试服务器
  58. changeOrigin: true,
  59. pathRewrite: {
  60. "^/mock": ""
  61. }
  62. },
  63. },
  64. })