瀏覽代碼

优化打包

神仙都没用 1 年之前
父節點
當前提交
ba0525f559
共有 5 個文件被更改,包括 1251 次插入4436 次删除
  1. 1 1
      package.json
  2. 1235 4426
      packages/crud/pnpm-lock.yaml
  3. 4 4
      pnpm-lock.yaml
  4. 0 0
      stats.html
  5. 11 5
      vite.config.mts

+ 1 - 1
package.json

@@ -9,7 +9,7 @@
 		"lint:eslint": "eslint \"./src/**/*.{vue,ts,tsx}\" --fix"
 	},
 	"dependencies": {
-		"@cool-vue/crud": "^7.1.24",
+		"@cool-vue/crud": "^7.1.26",
 		"@element-plus/icons-vue": "^2.3.1",
 		"@vueuse/core": "^10.4.0",
 		"@wangeditor/editor": "^5.1.23",

File diff suppressed because it is too large
+ 1235 - 4426
packages/crud/pnpm-lock.yaml


+ 4 - 4
pnpm-lock.yaml

@@ -6,8 +6,8 @@ settings:
 
 dependencies:
   '@cool-vue/crud':
-    specifier: ^7.1.23
-    version: 7.1.23(typescript@5.2.2)
+    specifier: ^7.1.26
+    version: 7.1.26(typescript@5.2.2)
   '@element-plus/icons-vue':
     specifier: ^2.3.1
     version: 2.3.1(vue@3.4.15)
@@ -482,8 +482,8 @@ packages:
       '@babel/helper-validator-identifier': 7.24.7
       to-fast-properties: 2.0.0
 
-  /@cool-vue/crud@7.1.23(typescript@5.2.2):
-    resolution: {integrity: sha512-0YmMorDU/3AOVH+hg01IcCt1y7CmSA35P9W3kmlJb2KXnAHnvWA72Bg7yrbl6M2l38ziUpU5eKnZTjd47/ZVZw==}
+  /@cool-vue/crud@7.1.26(typescript@5.2.2):
+    resolution: {integrity: sha512-v8X32My5iGqt048FWkthMxVdOY5kTf2MVLIHyr8NoCEbSFN4vzDSbLE6TWgQMHd62GCDxlB9e/QQGCc55CZGcA==}
     dependencies:
       '@element-plus/icons-vue': 2.3.1(vue@3.4.15)
       array.prototype.flat: 1.3.2

File diff suppressed because it is too large
+ 0 - 0
stats.html


+ 11 - 5
vite.config.mts

@@ -6,6 +6,7 @@ import compression from "vite-plugin-compression";
 import { visualizer } from "rollup-plugin-visualizer";
 import { proxy } from "./src/config/proxy";
 import { cool } from "@cool-vue/vite-plugin";
+import { constants } from "crypto";
 
 function resolve(dir: string) {
 	return path.resolve(__dirname, ".", dir);
@@ -58,6 +59,7 @@ export default ({ mode }: ConfigEnv): UserConfig => {
 		esbuild: {
 			drop: isDev(mode) ? [] : ["console", "debugger"]
 		},
+
 		build: {
 			minify: "esbuild",
 			// terserOptions: {
@@ -75,13 +77,17 @@ export default ({ mode }: ConfigEnv): UserConfig => {
 					manualChunks(id) {
 						if (id.includes("node_modules")) {
 							if (!["@cool-vue/crud"].find((e) => id.includes(e))) {
-								let str = id.toString().split("node_modules/")[1];
-
-								if (str[0] == "@") {
-									str = str.replace("/", ".");
+								if (id.includes("prettier")) {
+									return;
 								}
 
-								return str.split("/")[0].toString();
+								return id
+									.toString()
+									.split("node_modules/")[1]
+									.replace(".pnpm/", "")
+									.split("/")[0];
+							} else {
+								return "comm";
 							}
 						}
 					}

Some files were not shown because too many files changed in this diff