123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105 |
- import { defineConfig, loadEnv } from "vite";
- import vue from "@vitejs/plugin-vue";
- import path from "path";
- import Icons from "unplugin-icons/vite";
- import IconsResolver from "unplugin-icons/resolver";
- import AutoImport from "unplugin-auto-import/vite";
- import Components from "unplugin-vue-components/vite";
- import { createSvgIconsPlugin } from "vite-plugin-svg-icons";
- import { ElementPlusResolver } from "unplugin-vue-components/resolvers";
- import zipBuildPlugin from './zipBuildPlugin';
- export default defineConfig(({ mode }) => {
- const ENV = loadEnv(mode, process.cwd());
- return {
- base: ENV.VITE_APP_BASE_URL,
- plugins: [
- vue(),
- AutoImport({
-
- imports: ["vue"],
- resolvers: [
- ElementPlusResolver(),
-
- IconsResolver({
- prefix: "Icon",
- }),
- ],
- }),
- Components({
- resolvers: [
- ElementPlusResolver(),
-
- IconsResolver({
- enabledCollections: ["ep"],
- }),
- {
- type: 'directive',
- resolve: (name) => {
- if (name === 'Loading') {
- return {
- name: 'vLoading',
- from: `element-plus/es/components/loading/src/directive`
- };
- } else {
- return;
- }
- },
- }
- ],
- directives: true
- }),
- Icons({
- autoInstall: true,
- }),
- createSvgIconsPlugin({
-
- iconDirs: [path.resolve(process.cwd(), "src/assets/svg")],
-
- symbolId: "[name]",
-
-
-
-
- }),
- zipBuildPlugin()
- ],
- css: {
-
- preprocessorOptions: {
- scss: {
-
-
-
- },
- },
- },
- resolve: {
- alias: {
- "@": path.resolve(__dirname, "./src"),
- },
- },
- build: {
- outDir: ENV.VITE_APP_OUTDIR,
- },
- server: {
- port: 8706,
- proxy: {
- "/v1": {
- target: "http://8.136.199.33:8705/adminapi",
- changeOrigin: true,
- rewrite: (path) => path.replace(/^\/v1/, ""),
- },
- },
- },
- };
- });
|