You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
pest_admin/vite.config.js.timestamp-17...

142 lines
17 KiB
JavaScript

// vite.config.js
import { defineConfig, loadEnv } from "file:///D:/projects/AEO/node_modules/.pnpm/vite@5.3.2_@types+node@22.10.1_sass@1.77.5/node_modules/vite/dist/node/index.js";
import path2 from "path";
// vite/plugins/index.js
import vue from "file:///D:/projects/AEO/node_modules/.pnpm/@vitejs+plugin-vue@5.0.5_vite@5.3.2_@types+node@22.10.1_sass@1.77.5__vue@3.4.31/node_modules/@vitejs/plugin-vue/dist/index.mjs";
// vite/plugins/auto-import.js
import autoImport from "file:///D:/projects/AEO/node_modules/.pnpm/unplugin-auto-import@0.17.6_@vueuse+core@10.11.0_vue@3.4.31__rollup@4.28.0/node_modules/unplugin-auto-import/dist/vite.js";
function createAutoImport() {
return autoImport({
imports: [
"vue",
"vue-router",
"pinia"
],
dts: false
});
}
// vite/plugins/svg-icon.js
import { createSvgIconsPlugin } from "file:///D:/projects/AEO/node_modules/.pnpm/vite-plugin-svg-icons@2.0.1_vite@5.3.2_@types+node@22.10.1_sass@1.77.5_/node_modules/vite-plugin-svg-icons/dist/index.mjs";
import path from "path";
function createSvgIcon(isBuild) {
return createSvgIconsPlugin({
iconDirs: [path.resolve(process.cwd(), "src/assets/icons/svg")],
symbolId: "icon-[dir]-[name]",
svgoOptions: isBuild
});
}
// vite/plugins/compression.js
import compression from "file:///D:/projects/AEO/node_modules/.pnpm/vite-plugin-compression@0.5.1_vite@5.3.2_@types+node@22.10.1_sass@1.77.5_/node_modules/vite-plugin-compression/dist/index.mjs";
function createCompression(env) {
const { VITE_BUILD_COMPRESS } = env;
const plugin = [];
if (VITE_BUILD_COMPRESS) {
const compressList = VITE_BUILD_COMPRESS.split(",");
if (compressList.includes("gzip")) {
plugin.push(
compression({
ext: ".gz",
deleteOriginFile: false
})
);
}
if (compressList.includes("brotli")) {
plugin.push(
compression({
ext: ".br",
algorithm: "brotliCompress",
deleteOriginFile: false
})
);
}
}
return plugin;
}
// vite/plugins/setup-extend.js
import setupExtend from "file:///D:/projects/AEO/node_modules/.pnpm/unplugin-vue-setup-extend-plus@1.0.1/node_modules/unplugin-vue-setup-extend-plus/dist/vite.js";
function createSetupExtend() {
return setupExtend({});
}
// vite/plugins/unocss.js
import UnoCSS from "file:///D:/projects/AEO/node_modules/.pnpm/unocss@0.65.1_postcss@5.2.18_rollup@4.28.0_vite@5.3.2_@types+node@22.10.1_sass@1.77.5__vue@3.4.31/node_modules/unocss/dist/vite.mjs";
function createUnoCss() {
return UnoCSS();
}
// vite/plugins/index.js
function createVitePlugins(viteEnv, isBuild = false) {
const vitePlugins = [vue()];
vitePlugins.push(createAutoImport());
vitePlugins.push(createSetupExtend());
vitePlugins.push(createSvgIcon(isBuild));
vitePlugins.push(createUnoCss());
isBuild && vitePlugins.push(...createCompression(viteEnv));
return vitePlugins;
}
// vite.config.js
var __vite_injected_original_dirname = "D:\\projects\\AEO";
var vite_config_default = defineConfig(({ mode, command }) => {
const env = loadEnv(mode, process.cwd());
const { VITE_APP_ENV } = env;
return {
// 部署生产环境和开发环境下的URL。
// 默认情况下vite 会假设你的应用是被部署在一个域名的根路径上
// 例如 https://www.ruoyi.vip/。如果应用被部署在一个子路径上,你就需要用这个选项指定这个子路径。例如,如果你的应用被部署在 https://www.ruoyi.vip/admin/,则设置 baseUrl 为 /admin/。
base: VITE_APP_ENV === "production" ? "/" : "/",
plugins: createVitePlugins(env, command === "build"),
resolve: {
// https://cn.vitejs.dev/config/#resolve-alias
alias: {
// 设置路径
"~": path2.resolve(__vite_injected_original_dirname, "./"),
// 设置别名
"@": path2.resolve(__vite_injected_original_dirname, "./src")
},
// https://cn.vitejs.dev/config/#resolve-extensions
extensions: [".mjs", ".js", ".ts", ".jsx", ".tsx", ".json", ".vue"]
},
// vite 相关配置
server: {
port: 80,
host: true,
open: true,
proxy: {
// https://cn.vitejs.dev/config/#server-proxy
"/dev-api": {
target: "http://192.168.0.111:8080",
changeOrigin: true,
rewrite: (p) => p.replace(/^\/dev-api/, "")
}
}
},
//fix:error:stdin>:7356:1: warning: "@charset" must be the first rule in the file
css: {
postcss: {
plugins: [
{
postcssPlugin: "internal:charset-removal",
AtRule: {
charset: (atRule) => {
if (atRule.name === "charset") {
atRule.remove();
}
}
}
}
]
}
}
};
});
export {
vite_config_default as default
};
//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsidml0ZS5jb25maWcuanMiLCAidml0ZS9wbHVnaW5zL2luZGV4LmpzIiwgInZpdGUvcGx1Z2lucy9hdXRvLWltcG9ydC5qcyIsICJ2aXRlL3BsdWdpbnMvc3ZnLWljb24uanMiLCAidml0ZS9wbHVnaW5zL2NvbXByZXNzaW9uLmpzIiwgInZpdGUvcGx1Z2lucy9zZXR1cC1leHRlbmQuanMiLCAidml0ZS9wbHVnaW5zL3Vub2Nzcy5qcyJdLAogICJzb3VyY2VzQ29udGVudCI6IFsiY29uc3QgX192aXRlX2luamVjdGVkX29yaWdpbmFsX2Rpcm5hbWUgPSBcIkQ6XFxcXHByb2plY3RzXFxcXEFFT1wiO2NvbnN0IF9fdml0ZV9pbmplY3RlZF9vcmlnaW5hbF9maWxlbmFtZSA9IFwiRDpcXFxccHJvamVjdHNcXFxcQUVPXFxcXHZpdGUuY29uZmlnLmpzXCI7Y29uc3QgX192aXRlX2luamVjdGVkX29yaWdpbmFsX2ltcG9ydF9tZXRhX3VybCA9IFwiZmlsZTovLy9EOi9wcm9qZWN0cy9BRU8vdml0ZS5jb25maWcuanNcIjtpbXBvcnQgeyBkZWZpbmVDb25maWcsIGxvYWRFbnYgfSBmcm9tIFwidml0ZVwiO1xyXG5pbXBvcnQgcGF0aCBmcm9tIFwicGF0aFwiO1xyXG5pbXBvcnQgY3JlYXRlVml0ZVBsdWdpbnMgZnJvbSBcIi4vdml0ZS9wbHVnaW5zXCI7XHJcblxyXG4vLyBodHRwczovL3ZpdGVqcy5kZXY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2ZXItcHJveHlcclxuICAgICAgICBcIi9kZXYtYXBpXCI6IHtcclxuICAgICAgICAgIHRhcmdldDogXCJodHRwOi8vMTkyLjE2OC4wLjExMTo4MDgwXCIsXHJcbiAgICAgICAgICBjaGFuZ2VPcmlnaW46IHRydWUsXHJcbiAgICAgICAgICByZXdyaXRlOiAocCkgPT4gcC5yZXBsYWNlKC9eXFwvZGV2LWFwaS8sIFwiXCIpLFxyXG4gICAgICAgIH0sXHJcbiAgICAgIH0sXHJcbiAgICB9LFxyXG4gICAgLy9maXg6ZXJyb3I6c3RkaW4+OjczNTY6MTogd2FybmluZzogXCJAY2hhcnNldFwiIG11c3QgYmUgdGhlIGZpcnN0IHJ1bGUgaW4gdGhlIGZpbGVcclxuICAgIGNzczoge1xyXG4gICAgICBwb3N0Y3NzOiB7XHJcbiAgICAgICAgcGx1Z2luczogW1xyXG4gICAgICAgICAge1xyXG4gICAgICAgICAgICBwb3N0Y3NzUGx1Z2luOiBcImludGVybmFsOmNoYXJzZXQtcmVtb3ZhbFwiLFxyXG4gICAgICAgICAgICBBdFJ1bGU6IHtcclxuICAgICAgICAgICAgICBjaGFyc2V0OiAoYXRSdWxlKSA9PiB7XHJcbiAgICAgICAgICAgICAgICBpZiAoYXRSdWxlLm5hbWUgPT09IFwiY2hhcnNldFwiKSB7XHJcbiAgICAgICAgICAgICAgICAgIGF0UnVsZS5yZW1vdmUoKTtcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICB9LFxyXG4gICAgICAgICAgICB9LFxyXG4gICAgICAgICAgfSxcclxuICAgICAgICBdLFxyXG4gICAgICB9LFxyXG4gICAgfSxcclxuICB9O1xyXG59KTtcclxuIiwgImNvbnN0IF9fdml0ZV9pbmplY3RlZF9vcmlnaW5hbF9kaXJuYW1lID0gXCJEOlxcXFxwcm9qZ