1 Star 0 Fork 0

zangang/zhityuan-admins

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
vite.config.js.timestamp-1683190911123.mjs 7.19 KB
一键复制 编辑 原始数据 按行查看 历史
zangang 提交于 2024-02-26 15:30 . feat: 搭建管理端
// vite.config.js
import path from "path";
import { defineConfig, loadEnv } from "file:///D:/code/Vue/recycling/node_modules/vite/dist/node/index.js";
import vue from "file:///D:/code/Vue/recycling/node_modules/@vitejs/plugin-vue/dist/index.mjs";
import AutoImport from "file:///D:/code/Vue/recycling/node_modules/unplugin-auto-import/dist/vite.js";
import viteCompression from "file:///D:/code/Vue/recycling/node_modules/vite-plugin-compression/dist/index.mjs";
var __vite_injected_original_dirname = "D:\\code\\Vue\\recycling";
var vite_config_default = defineConfig(({ command, mode }) => {
const root = process.cwd();
const env = loadEnv(mode, root);
return {
// publicDir: "/src",
//配置全局的字符替换
resolve: {
alias: {
"@": path.resolve(__vite_injected_original_dirname, "src")
},
extensions: [".js", ".ts", ".jsx", ".tsx", ".json", ".vue"]
},
//配置插件
plugins: [
vue(),
AutoImport({
imports: ["vue", "vue-router"]
}),
viteCompression({
verbose: true,
disable: false,
threshold: 10240,
algorithm: "gzip",
ext: ".gz"
})
],
//配置代理
server: {
open: false,
port: 9081,
cors: true,
proxy: {
"/api": {
target: env.VITE_BASE_URL,
changeOrigin: true
}
},
historyApiFallback: {
index: "/index.html"
//与output的publicPath
}
},
//配置文件的拆分
rollupOptions: {
output: {
//配置之后就会每种类型的文件放在各自的文件夹上
chunkFileNames: "static/js/[name]-[hash].js",
entryFileNames: "static/js/[name]-[hash].js",
assetFileNames: "static/[ext]/[name]-[hash].[ext]",
//大文件进行切割
manualChunks(id) {
if (id.includes("node_modules")) {
return id.toString().split("node_modules/")[1].split("/")[0].toString();
}
}
}
}
};
});
export {
vite_config_default as default
};
//# sourceM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E9BQU8sWUFBWTtBQUFBLE1BQy9CLENBQUM7QUFBQSxNQUNELGdCQUFnQjtBQUFBLFFBQ2QsU0FBUztBQUFBLFFBQ1QsU0FBUztBQUFBLFFBQ1QsV0FBVztBQUFBLFFBQ1gsV0FBVztBQUFBLFFBQ1gsS0FBSztBQUFBLE1BQ1AsQ0FBQztBQUFBLElBQ0g7QUFBQTtBQUFBLElBR0EsUUFBUTtBQUFBLE1BQ04sTUFBTTtBQUFBLE1BQ04sTUFBTTtBQUFBLE1BQ04sTUFBTTtBQUFBLE1BQ04sT0FBTztBQUFBLFFBQ0wsUUFBUTtBQUFBLFVBQ04sUUFBUSxJQUFJO0FBQUEsVUFDWixjQUFjO0FBQUEsUUFDaEI7QUFBQSxNQUNGO0FBQUEsTUFDQSxvQkFBb0I7QUFBQSxRQUNsQixPQUFPO0FBQUE7QUFBQSxNQUNUO0FBQUEsSUFDRjtBQUFBO0FBQUEsSUFHQSxlQUFlO0FBQUEsTUFDYixRQUFRO0FBQUE7QUFBQSxRQUVOLGdCQUFnQjtBQUFBLFFBQ2hCLGdCQUFnQjtBQUFBLFFBQ2hCLGdCQUFnQjtBQUFBO0FBQUEsUUFFaEIsYUFBYSxJQUFJO0FBQ2YsY0FBSSxHQUFHLFNBQVMsY0FBYyxHQUFHO0FBQy9CLG1CQUFPLEdBQ0osU0FBUyxFQUNULE1BQU0sZUFBZSxFQUFFLENBQUMsRUFDeEIsTUFBTSxHQUFHLEVBQUUsQ0FBQyxFQUNaLFNBQVM7QUFBQSxVQUNkO0FBQUEsUUFDRjtBQUFBLE1BQ0Y7QUFBQSxJQUNGO0FBQUEsRUFDRjtBQUNGLENBQUM7IiwKICAibmFtZXMiOiBbXQp9Cg==
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/zangang/zhityuan-admins.git
[email protected]:zangang/zhityuan-admins.git
zangang
zhityuan-admins
zhityuan-admins
master

搜索帮助