Blame view

美国版/Food Labeling Management App UniApp/vite.config.ts 620 Bytes
b165f94a   “wangming”   111
1
2
3
4
5
  import { defineConfig } from "vite";
  import uni from "@dcloudio/vite-plugin-uni";
  
  // https://vitejs.dev/config/
  export default defineConfig({
940fb6ea   “wangming”   又改了一个版本,这泰额太纠结了,一...
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
    base: "/app/",
    plugins: [
      uni(),
      {
        name: "redirect-root-to-app",
        configureServer(server) {
          server.middlewares.use((req, res, next) => {
            const url = (req.url || "/").split("?")[0];
            if (url === "/" || url === "/index.html") {
              res.writeHead(302, { Location: "/app/" });
              res.end();
              return;
            }
            next();
          });
        },
      },
    ],
    server: {
      open: "/app/",
    },
b165f94a   “wangming”   111
27
  });