123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134 |
- import { defineConfig, loadEnv } from "file:///D:/HBuilderProjects/RuoYi-Vue3/node_modules/vite/dist/node/index.js";
- import path2 from "path";
- import vue from "file:///D:/HBuilderProjects/RuoYi-Vue3/node_modules/@vitejs/plugin-vue/dist/index.mjs";
- import autoImport from "file:///D:/HBuilderProjects/RuoYi-Vue3/node_modules/unplugin-auto-import/dist/vite.js";
- function createAutoImport() {
- return autoImport({
- imports: [
- "vue",
- "vue-router",
- "pinia"
- ],
- dts: false
- });
- }
- import { createSvgIconsPlugin } from "file:///D:/HBuilderProjects/RuoYi-Vue3/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
- });
- }
- import compression from "file:///D:/HBuilderProjects/RuoYi-Vue3/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;
- }
- import setupExtend from "file:///D:/HBuilderProjects/RuoYi-Vue3/node_modules/unplugin-vue-setup-extend-plus/dist/vite.js";
- function createSetupExtend() {
- return setupExtend({});
- }
- function createVitePlugins(viteEnv, isBuild = false) {
- const vitePlugins = [vue()];
- vitePlugins.push(createAutoImport());
- vitePlugins.push(createSetupExtend());
- vitePlugins.push(createSvgIcon(isBuild));
- isBuild && vitePlugins.push(...createCompression(viteEnv));
- return vitePlugins;
- }
- var __vite_injected_original_dirname = "D:\\HBuilderProjects\\RuoYi-Vue3";
- var vite_config_default = defineConfig(({ mode, command }) => {
- const env = loadEnv(mode, process.cwd());
- const { VITE_APP_ENV } = env;
- return {
-
-
-
- base: VITE_APP_ENV === "production" ? "/" : "/",
- plugins: createVitePlugins(env, command === "build"),
- resolve: {
-
- alias: {
-
- "~": path2.resolve(__vite_injected_original_dirname, "./"),
-
- "@": path2.resolve(__vite_injected_original_dirname, "./src")
- },
-
- extensions: [".mjs", ".js", ".ts", ".jsx", ".tsx", ".json", ".vue"]
- },
-
- server: {
- port: 80,
- host: true,
- open: true,
- proxy: {
-
- "/dev-api": {
- target: "http://localhost:8080",
- changeOrigin: true,
- rewrite: (p) => p.replace(/^\/dev-api/, "")
- }
- }
- },
-
- css: {
- postcss: {
- plugins: [
- {
- postcssPlugin: "internal:charset-removal",
- AtRule: {
- charset: (atRule) => {
- if (atRule.name === "charset") {
- atRule.remove();
- }
- }
- }
- }
- ]
- }
- }
- };
- });
- export {
- vite_config_default as default
- };
|