gaoluyang
9 小时以前 b64a0deae5b5d33f9e20671a68936b27f0b9b00b
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
import { defineConfig } from "./internal/vite-config/src";
 
export default defineConfig(async () => {
  return {
    application: {},
    vite: {
      oxc: {
        enable: false,
      },
      optimizeDeps: {
        include: ["vue", "vue-router", "pinia", "ant-design-vue", "dayjs", "@vueuse/core", "axios"],
        exclude: ["dhtmlx-gantt", "tinymce", "bpmn-js", "bpmn-js-properties-panel", "video.js"],
      },
      build: {
        rollupOptions: {
          output: {
            manualChunks: id => {
              if (id.includes("node_modules")) {
                if (["vue", "vue-router", "pinia"].some(dep => id.includes(dep))) {
                  return "vendor-vue";
                }
                if (["ant-design-vue", "@vueuse/core"].some(dep => id.includes(dep))) {
                  return "vendor-ui";
                }
                if (["dayjs", "axios", "@vee-validate/zod", "zod"].some(dep => id.includes(dep))) {
                  return "vendor-utils";
                }
                if (["tinymce", "@tinymce/tinymce-vue", "@form-create/ant-design-vue"].some(dep => id.includes(dep))) {
                  return "vendor-editor";
                }
              }
            },
          },
        },
      },
      server: {
        allowedHosts: true,
        watch: {
          ignored: ["**/node_modules/**", "**/dist/**", "**/.git/**"],
        },
        proxy: {
          "/admin-api": {
            changeOrigin: true,
            rewrite: path => path.replace(/^\/admin-api/, ""),
            target: "http://192.168.0.226:48080/admin-api",
            ws: true,
          },
        },
      },
    },
  };
});