123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172 |
- import { defineConfig } from "vite";
- import vue from "@vitejs/plugin-vue";
- import Components from "unplugin-vue-components/vite";
- import { AntDesignVueResolver } from "unplugin-vue-components/resolvers";
- import { createSvgIconsPlugin } from "vite-plugin-svg-icons";
- import { resolve } from "path";
- const resolvePath = (...args) => {
- return resolve(__dirname, ...args);
- };
- // const SERVER_URL = "http://192.168.10.108:7180";
- // const SERVER_URL = "http://192.168.10.138:13800";
- const SERVER_URL = "http://192.168.10.39:7100";
- // const SERVER_URL = "http://192.168.10.141:7100";
- // const SERVER_URL = "http://192.168.10.106:7100";
- // https://vitejs.dev/config/
- export default defineConfig({
- plugins: [
- vue({
- reactivityTransform: true,
- }),
- Components({
- resolvers: [
- AntDesignVueResolver({
- importStyle: false,
- }),
- ],
- }),
- createSvgIconsPlugin({
- iconDirs: [resolvePath("src/assets/svgs")],
- symbolId: "icon-[name]",
- customDomId: "__svg__icons__dom__",
- svgoOptions: {
- full: true,
- plugins: [
- {
- name: "removeAttrs",
- params: {
- attrs: ["class", "data-name", "fill", "stroke"],
- },
- },
- ],
- },
- }),
- ],
- server: {
- port: 9000,
- // strictPort: true,
- fs: {
- strict: true,
- allow: ["./"],
- },
- proxy: {
- "/api": {
- target: SERVER_URL,
- changeOrigin: true,
- },
- },
- },
- resolve: {
- alias: [{ find: "@", replacement: resolve(__dirname, "./src") }],
- extensions: [".js", ".mjs", ".ts", ".vue", ".json", ".scss", ".css"],
- },
- build: {
- ssr: false,
- },
- // define: {
- // __VUE_PROD_DEVTOOLS__: true, // no effect
- // },
- });
|