.umirc.ts 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. import { defineConfig } from "umi";
  2. export default defineConfig({
  3. base: "/",
  4. publicPath: process.env.NODE_ENV === "production" ? "./" : "/",
  5. outputPath: "marketplace",
  6. esbuildMinifyIIFE: true,
  7. favicons: [],
  8. styles: ["//at.alicdn.com/t/c/font_4840729_qt3oesd105.css"],
  9. scripts: ["//at.alicdn.com/t/c/font_4840729_qpwqs1eruu.js"],
  10. model: {},
  11. title: "易码工坊",
  12. metas: [
  13. {
  14. name: "viewport",
  15. content:
  16. "width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no",
  17. },
  18. ],
  19. history: {
  20. type: "hash",
  21. },
  22. plugins: [
  23. require.resolve('@umijs/plugins/dist/unocss'),
  24. require.resolve('@umijs/plugins/dist/model'),
  25. require.resolve('@umijs/plugins/dist/initial-state'),
  26. require.resolve('@umijs/plugins/dist/request'),
  27. ],
  28. // model: {},
  29. unocss: {
  30. watch: ["src/**/*.tsx"],
  31. },
  32. request: {
  33. dataField: '',
  34. },
  35. proxy: {
  36. "/api": {
  37. target: "https://design.shalu.com/",
  38. changeOrigin: true,
  39. pathRewrite: { "^/api": "" },
  40. },
  41. },
  42. routes: [
  43. {
  44. path: "/",
  45. redirect: "/application",
  46. },
  47. {
  48. path: "/application",
  49. component: "application",
  50. },
  51. {
  52. path: "/template",
  53. component: "template",
  54. },
  55. {
  56. // type: application or template
  57. path: "/detail/:type/:id",
  58. component: "detail",
  59. },
  60. {
  61. path: '/management',
  62. component: 'management',
  63. layout: false
  64. },
  65. {
  66. path: '/ai',
  67. component: 'ai',
  68. layout: false
  69. },
  70. {
  71. path: '/apply',
  72. component: 'apply',
  73. layout: false
  74. },
  75. {
  76. path: '*',
  77. component: '404',
  78. layout: false
  79. }
  80. ],
  81. npmClient: "pnpm",
  82. });