From 239933482fd30e099ab9d038bc1a2e0164a65cb4 Mon Sep 17 00:00:00 2001
From: gjj <Ganjj@probim.com.cn>
Date: Mon, 17 Mar 2025 14:41:10 +0800
Subject: [PATCH] 增加标段筛选和接口字段,调整样式,增加全局放大
---
vite.config.js | 21 ++++++++++++++++++++-
1 files changed, 20 insertions(+), 1 deletions(-)
diff --git a/vite.config.js b/vite.config.js
index 55294e5..35a9e98 100644
--- a/vite.config.js
+++ b/vite.config.js
@@ -2,7 +2,7 @@
* @Author: gjj Ganjj@probim.com.cn
* @Date: 2025-02-14 14:32:19
* @LastEditors: gjj Ganjj@probim.com.cn
- * @LastEditTime: 2025-02-24 17:26:18
+ * @LastEditTime: 2025-03-17 11:38:32
* @FilePath: \北京交通大学\vite.config.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
@@ -12,6 +12,13 @@
// splitVendorChunk, isCSSRequest
import PluginForViteVue2 from "@vitejs/plugin-vue2";
+// 屏幕适配
+const px2rem = require("postcss-px2rem")
+ // 配置基本大小
+const postcss = px2rem({
+ //配rem基准值 基准大小 baseSize
+ remUnit: 192, // 设稿尺1920/10
+})
export default defineConfig(({ mode }) => {
return {
@@ -54,6 +61,18 @@
treeShaking: true,
drop: mode === "production" ? ["console", "debugger"] : [],
},
+ chainWebpack(config) {
+ config.module.rule("css").test(/\.css$/).oneOf("vue").use("px2rem-loader").loader("px2rem-loader").options({
+ remUnit: 192,
+ }).end();
+ },
+ css: {
+ loaderOptions: {
+ postcss: {
+ plugins: [postcss]
+ }
+ }
+ },
build: {
minify: "esbuild",
chunkSizeWarningLimit: 500, //kbs
--
Gitblit v1.9.3