|
@@ -1,4 +1,4 @@
|
|
|
-import { defineConfig } from "vite";
|
|
|
+import { defineConfig, normalizePath,Plugin } from "vite";
|
|
|
import vue from "@vitejs/plugin-vue";
|
|
|
import ViteComponents from "unplugin-vue-components/vite";
|
|
|
import { AntDesignVueResolver } from "unplugin-vue-components/resolvers";
|
|
@@ -6,6 +6,18 @@ import { AntDesignVueResolver } from "unplugin-vue-components/resolvers";
|
|
|
const SERVER_URL = "http://192.168.10.224:80";
|
|
|
const path = require("path");
|
|
|
|
|
|
+function mockDevLogin(): Plugin {
|
|
|
+ return {
|
|
|
+ name: "mockDevLogin",
|
|
|
+ apply: "build",
|
|
|
+ load(id) {
|
|
|
+ if (id === normalizePath(path.resolve(__dirname, "src/devLogin.ts"))) {
|
|
|
+ return `export default {initLogin(){}}`;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ };
|
|
|
+}
|
|
|
+
|
|
|
// https://vitejs.dev/config/
|
|
|
export default defineConfig({
|
|
|
plugins: [
|
|
@@ -16,6 +28,7 @@ export default defineConfig({
|
|
|
resolvers: [AntDesignVueResolver()],
|
|
|
dts: true,
|
|
|
}),
|
|
|
+ mockDevLogin(),
|
|
|
],
|
|
|
server: {
|
|
|
port: 9000,
|