school_file_web/vite.config.ts.timestamp-17...

277 lines
36 KiB
JavaScript
Raw Normal View History

2024-06-24 07:08:58 +00:00
// vite.config.ts
import { loadEnv, defineConfig } from "file:///D:/project/work/gitea/school_file_web/node_modules/.pnpm/vite@5.2.10_@types+node@18.18.2_sass@1.72.0/node_modules/vite/dist/node/index.js";
// vite/plugins/index.ts
import vue from "file:///D:/project/work/gitea/school_file_web/node_modules/.pnpm/@vitejs+plugin-vue@5.0.4_vite@5.2.10_vue@3.4.25/node_modules/@vitejs/plugin-vue/dist/index.mjs";
// vite/plugins/unocss.ts
import UnoCss from "file:///D:/project/work/gitea/school_file_web/node_modules/.pnpm/unocss@0.58.6_postcss@8.4.36_vite@5.2.10/node_modules/unocss/dist/vite.mjs";
var unocss_default = () => {
return UnoCss({
hmrTopLevelAwait: false
// unocss默认是true低版本浏览器是不支持的启动后会报错
});
};
// vite/plugins/auto-import.ts
import AutoImport from "file:///D:/project/work/gitea/school_file_web/node_modules/.pnpm/unplugin-auto-import@0.17.5_@vueuse+core@10.9.0/node_modules/unplugin-auto-import/dist/vite.js";
import { ElementPlusResolver } from "file:///D:/project/work/gitea/school_file_web/node_modules/.pnpm/unplugin-vue-components@0.26.0_vue@3.4.25/node_modules/unplugin-vue-components/dist/resolvers.js";
import IconsResolver from "file:///D:/project/work/gitea/school_file_web/node_modules/.pnpm/unplugin-icons@0.18.5_@vue+compiler-sfc@3.4.23/node_modules/unplugin-icons/dist/resolver.js";
var __vite_injected_original_dirname = "D:\\project\\work\\gitea\\school_file_web\\vite\\plugins";
var auto_import_default = (path3) => {
return AutoImport({
// 自动导入 Vue 相关函数
imports: ["vue", "vue-router", "@vueuse/core", "pinia"],
eslintrc: {
enabled: false,
filepath: "./.eslintrc-auto-import.json",
globalsPropValue: true
},
resolvers: [
// 自动导入 Element Plus 相关函数ElMessage, ElMessageBox... (带样式)
ElementPlusResolver(),
IconsResolver({
prefix: "Icon"
})
],
vueTemplate: true,
// 是否在 vue 模板中自动导入
dts: path3.resolve(path3.resolve(__vite_injected_original_dirname, "../../src"), "types", "auto-imports.d.ts")
});
};
// vite/plugins/components.ts
import Components from "file:///D:/project/work/gitea/school_file_web/node_modules/.pnpm/unplugin-vue-components@0.26.0_vue@3.4.25/node_modules/unplugin-vue-components/dist/vite.js";
import { ElementPlusResolver as ElementPlusResolver2 } from "file:///D:/project/work/gitea/school_file_web/node_modules/.pnpm/unplugin-vue-components@0.26.0_vue@3.4.25/node_modules/unplugin-vue-components/dist/resolvers.js";
import IconsResolver2 from "file:///D:/project/work/gitea/school_file_web/node_modules/.pnpm/unplugin-icons@0.18.5_@vue+compiler-sfc@3.4.23/node_modules/unplugin-icons/dist/resolver.js";
var __vite_injected_original_dirname2 = "D:\\project\\work\\gitea\\school_file_web\\vite\\plugins";
var components_default = (path3) => {
return Components({
resolvers: [
// 自动导入 Element Plus 组件
ElementPlusResolver2(),
// 自动注册图标组件
IconsResolver2({
enabledCollections: ["ep"]
})
],
dts: path3.resolve(path3.resolve(__vite_injected_original_dirname2, "../../src"), "types", "components.d.ts")
});
};
// vite/plugins/icons.ts
import Icons from "file:///D:/project/work/gitea/school_file_web/node_modules/.pnpm/unplugin-icons@0.18.5_@vue+compiler-sfc@3.4.23/node_modules/unplugin-icons/dist/vite.js";
var icons_default = () => {
return Icons({
// 自动安装图标库
autoInstall: true
});
};
// vite/plugins/svg-icon.ts
import { createSvgIconsPlugin } from "file:///D:/project/work/gitea/school_file_web/node_modules/.pnpm/vite-plugin-svg-icons@2.0.1_vite@5.2.10/node_modules/vite-plugin-svg-icons/dist/index.mjs";
var __vite_injected_original_dirname3 = "D:\\project\\work\\gitea\\school_file_web\\vite\\plugins";
var svg_icon_default = (path3, isBuild) => {
return createSvgIconsPlugin({
// 指定需要缓存的图标文件夹
iconDirs: [path3.resolve(path3.resolve(__vite_injected_original_dirname3, "../../src"), "assets/icons/svg")],
// 指定symbolId格式
symbolId: "icon-[dir]-[name]",
svgoOptions: isBuild
});
};
// vite/plugins/compression.ts
import compression from "file:///D:/project/work/gitea/school_file_web/node_modules/.pnpm/vite-plugin-compression@0.5.1_vite@5.2.10/node_modules/vite-plugin-compression/dist/index.mjs";
var compression_default = (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.ts
import setupExtend from "file:///D:/project/work/gitea/school_file_web/node_modules/.pnpm/unplugin-vue-setup-extend-plus@1.0.1/node_modules/unplugin-vue-setup-extend-plus/dist/vite.js";
var setup_extend_default = () => {
return setupExtend({});
};
// vite/plugins/i18n.ts
import VueI18nPlugin from "file:///D:/project/work/gitea/school_file_web/node_modules/.pnpm/@intlify+unplugin-vue-i18n@3.0.1_vue-i18n@9.10.2/node_modules/@intlify/unplugin-vue-i18n/lib/vite.mjs";
var __vite_injected_original_dirname4 = "D:\\project\\work\\gitea\\school_file_web\\vite\\plugins";
var i18n_default = (path3) => {
return VueI18nPlugin({
include: [path3.resolve(__vite_injected_original_dirname4, "../../src/lang/**.json")]
});
};
// vite/plugins/index.ts
import path from "path";
var plugins_default = (viteEnv, isBuild = false) => {
const vitePlugins = [];
vitePlugins.push(vue());
vitePlugins.push(unocss_default());
vitePlugins.push(auto_import_default(path));
vitePlugins.push(components_default(path));
vitePlugins.push(compression_default(viteEnv));
vitePlugins.push(icons_default());
vitePlugins.push(svg_icon_default(path, isBuild));
vitePlugins.push(setup_extend_default());
vitePlugins.push(i18n_default(path));
return vitePlugins;
};
// vite.config.ts
import path2 from "path";
var __vite_injected_original_dirname5 = "D:\\project\\work\\gitea\\school_file_web";
var vite_config_default = defineConfig(({ mode, command }) => {
const env = loadEnv(mode, process.cwd());
return {
build: {
outDir: "school",
chunkSizeWarningLimit: 1600
},
// 部署生产环境和开发环境下的URL。
// 默认情况下vite 会假设你的应用是被部署在一个域名的根路径上
// 例如 https://www.ruoyi.vip/。如果应用被部署在一个子路径上,你就需要用这个选项指定这个子路径。例如,如果你的应用被部署在 https://www.ruoyi.vip/admin/,则设置 baseUrl 为 /admin/。
base: env.VITE_APP_CONTEXT_PATH,
resolve: {
alias: {
"~": path2.resolve(__vite_injected_original_dirname5, "./"),
"@": path2.resolve(__vite_injected_original_dirname5, "./src")
},
extensions: [".mjs", ".js", ".ts", ".jsx", ".tsx", ".json", ".vue"]
},
// https://cn.vitejs.dev/config/#resolve-extensions
plugins: plugins_default(env, command === "build"),
server: {
host: "0.0.0.0",
port: Number(env.VITE_APP_PORT),
open: true,
proxy: {
[env.VITE_APP_BASE_API]: {
target: "http://localhost:8090",
changeOrigin: true,
ws: true,
rewrite: (path3) => path3.replace(new RegExp("^" + env.VITE_APP_BASE_API), "")
}
}
},
css: {
preprocessorOptions: {
scss: {
javascriptEnabled: true
}
},
postcss: {
plugins: [
{
postcssPlugin: "internal:charset-removal",
AtRule: {
charset: (atRule) => {
if (atRule.name === "charset") {
atRule.remove();
}
}
}
}
]
}
},
// 预编译
optimizeDeps: {
include: [
"vue",
"vue-router",
"pinia",
"axios",
"@vueuse/core",
"path-to-regexp",
"echarts",
"vue-i18n",
"@vueup/vue-quill",
"min-dash",
"tiny-svg",
"image-conversion",
"element-plus/es/components/text/style/css",
"element-plus/es/components/collapse-item/style/css",
"element-plus/es/components/collapse/style/css",
"element-plus/es/components/space/style/css",
"element-plus/es/components/container/style/css",
"element-plus/es/components/aside/style/css",
"element-plus/es/components/main/style/css",
"element-plus/es/components/header/style/css",
"element-plus/es/components/button-group/style/css",
"element-plus/es/components/radio-button/style/css",
"element-plus/es/components/checkbox-group/style/css",
"element-plus/es/components/form/style/css",
"element-plus/es/components/form-item/style/css",
"element-plus/es/components/button/style/css",
"element-plus/es/components/input/style/css",
"element-plus/es/components/input-number/style/css",
"element-plus/es/components/switch/style/css",
"element-plus/es/components/upload/style/css",
"element-plus/es/components/menu/style/css",
"element-plus/es/components/col/style/css",
"element-plus/es/components/icon/style/css",
"element-plus/es/components/row/style/css",
"element-plus/es/components/tag/style/css",
"element-plus/es/components/dialog/style/css",
"element-plus/es/components/loading/style/css",
"element-plus/es/components/radio/style/css",
"element-plus/es/components/radio-group/style/css",
"element-plus/es/components/popover/style/css",
"element-plus/es/components/scrollbar/style/css",
"element-plus/es/components/tooltip/style/css",
"element-plus/es/components/dropdown/style/css",
"element-plus/es/components/dropdown-menu/style/css",
"element-plus/es/components/dropdown-item/style/css",
"element-plus/es/components/sub-menu/style/css",
"element-plus/es/components/menu-item/style/css",
"element-plus/es/components/divider/style/css",
"element-plus/es/components/card/style/css",
"element-plus/es/components/link/style/css",
"element-plus/es/components/breadcrumb/style/css",
"element-plus/es/components/breadcrumb-item/style/css",
"element-plus/es/components/table/style/css",
"element-plus/es/components/tree-select/style/css",
"element-plus/es/components/table-column/style/css",
"element-plus/es/components/select/style/css",
"element-plus/es/components/option/style/css",
"element-plus/es/components/pagination/style/css",
"element-plus/es/components/tree/style/css",
"element-plus/es/components/alert/style/css",
"element-plus/es/components/checkbox/style/css",
"element-plus/es/components/date-picker/style/css",
"element-plus/es/components/transfer/style/css",
"element-plus/es/components/tabs/style/css",
"element-plus/es/components/image/style/css",
"element-plus/es/components/tab-pane/style/css"
]
}
};
});
export {
vite_config_default as default
};
//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsidml0ZS5jb25maWcudHMiLCAidml0ZS9wbHVnaW5zL2luZGV4LnRzIiwgInZpdGUvcGx1Z2lucy91bm9jc3MudHMiLCAidml0ZS9wbHVnaW5zL2F1dG8taW1wb3J0LnRzIiwgInZpdGUvcGx1Z2lucy9jb21wb25lbnRzLnRzIiwgInZpdGUvcGx1Z2lucy9pY29ucy50cyIsICJ2aXRlL3BsdWdpbnMvc3ZnLWljb24udHMiLCA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gQXRSdWxlOiB7XG4gICAgICAgICAgICAgIGNoYXJzZXQ6IChhdFJ1bGUpID0+IHtcbiAgICAgICAgICAgICAgICBpZiAoYXRSdWxlLm5hbWUgPT09ICdjaGFyc2V0Jykge1xuICAgICAgICAgICAgICAgICAgYXRSdWxlLnJlbW92ZSgpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cbiAgICAgICAgXVxuICAgICAgfVxuICAgIH0sXG4gICAgLy8gXHU5ODg0XHU3RjE2XHU4QkQxXG4gICAgb3B0aW1pemVEZXBzOiB7XG4gICAgICBpbmNsdWRlOiBbXG4gICAgICAgICd2dWUnLFxuICAgICAgICAndnVlLXJvdXRlcicsXG4gICAgICAgICdwaW5pYScsXG4gICAgICAgICdheGlvcycsXG4gICAgICAgICdAdnVldXNlL2Nvc