代码拉取完成,页面将自动刷新
同步操作将从 zhangjinlibra/workflow-web 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
"use strict";
import { fileURLToPath, URL } from "node:url";
import path from "path";
import vue from "@vitejs/plugin-vue";
import { defineConfig, loadEnv } from "vite";
// svg-icon
import { createSvgIconsPlugin } from "vite-plugin-svg-icons";
// arco按需加载
import AutoImport from "unplugin-auto-import/vite";
import Components from "unplugin-vue-components/vite";
import { ArcoResolver } from "unplugin-vue-components/resolvers";
// index.html title
import { createHtmlPlugin } from "vite-plugin-html";
import defaultSettings from "./src/settings.js";
// https://vitejs.dev/config/
export default defineConfig(({ command, mode }) => {
const env = loadEnv(mode, process.cwd());
console.log("env", env, mode, command);
return {
base: env.VITE_BASE_PATH,
plugins: [
vue(),
AutoImport({
resolvers: [ArcoResolver()],
}),
Components({
resolvers: [
ArcoResolver({
sideEffect: true,
}),
],
}),
createSvgIconsPlugin({
iconDirs: [path.resolve(process.cwd(), "src/icons/svg")],
symbolId: "icon-[dir]-[name]",
}),
createHtmlPlugin({
minify: true,
inject: {
data: {
title: defaultSettings.title,
path: env.VITE_BASE_PATH,
},
},
}),
],
build: {
minify: "terser",
terserOptions: {
compress: {
drop_console: command === "build",
drop_debugger: command === "build",
},
},
rollupOptions: {
output: {
minifyInternalExports: true,
// manualChunks: (id) => {
// // id对应的就是所有需要打包整合的文件
// if (id.includes("node_modules")) {
// return id.toString().split("node_modules/")[1].split("/")[0].toString();
// }
// },
},
},
},
resolve: {
alias: {
// '@': fileURLToPath(new URL('./src', import.meta.url)),
// '@': path.resolve(__dirname, './src'),
"@": path.resolve(path.dirname(fileURLToPath(import.meta.url)), "src"),
},
},
server: {
open: true,
https: false,
host: "127.0.0.1",
port: 5174,
proxy: {
"/flow2": {
target: "http://49.235.72.105",
changeOrigin: true,
rewrite: (path) => path.replace(/^\/flow2/, "/flow2"),
},
},
},
};
});
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。