mirror of
https://github.com/cool-team-official/cool-admin-vue.git
synced 2024-11-01 14:10:27 +08:00
优化打包
This commit is contained in:
parent
e5d8337a81
commit
ba0525f559
@ -9,7 +9,7 @@
|
|||||||
"lint:eslint": "eslint \"./src/**/*.{vue,ts,tsx}\" --fix"
|
"lint:eslint": "eslint \"./src/**/*.{vue,ts,tsx}\" --fix"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@cool-vue/crud": "^7.1.24",
|
"@cool-vue/crud": "^7.1.26",
|
||||||
"@element-plus/icons-vue": "^2.3.1",
|
"@element-plus/icons-vue": "^2.3.1",
|
||||||
"@vueuse/core": "^10.4.0",
|
"@vueuse/core": "^10.4.0",
|
||||||
"@wangeditor/editor": "^5.1.23",
|
"@wangeditor/editor": "^5.1.23",
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -6,8 +6,8 @@ settings:
|
|||||||
|
|
||||||
dependencies:
|
dependencies:
|
||||||
'@cool-vue/crud':
|
'@cool-vue/crud':
|
||||||
specifier: ^7.1.23
|
specifier: ^7.1.26
|
||||||
version: 7.1.23(typescript@5.2.2)
|
version: 7.1.26(typescript@5.2.2)
|
||||||
'@element-plus/icons-vue':
|
'@element-plus/icons-vue':
|
||||||
specifier: ^2.3.1
|
specifier: ^2.3.1
|
||||||
version: 2.3.1(vue@3.4.15)
|
version: 2.3.1(vue@3.4.15)
|
||||||
@ -482,8 +482,8 @@ packages:
|
|||||||
'@babel/helper-validator-identifier': 7.24.7
|
'@babel/helper-validator-identifier': 7.24.7
|
||||||
to-fast-properties: 2.0.0
|
to-fast-properties: 2.0.0
|
||||||
|
|
||||||
/@cool-vue/crud@7.1.23(typescript@5.2.2):
|
/@cool-vue/crud@7.1.26(typescript@5.2.2):
|
||||||
resolution: {integrity: sha512-0YmMorDU/3AOVH+hg01IcCt1y7CmSA35P9W3kmlJb2KXnAHnvWA72Bg7yrbl6M2l38ziUpU5eKnZTjd47/ZVZw==}
|
resolution: {integrity: sha512-v8X32My5iGqt048FWkthMxVdOY5kTf2MVLIHyr8NoCEbSFN4vzDSbLE6TWgQMHd62GCDxlB9e/QQGCc55CZGcA==}
|
||||||
dependencies:
|
dependencies:
|
||||||
'@element-plus/icons-vue': 2.3.1(vue@3.4.15)
|
'@element-plus/icons-vue': 2.3.1(vue@3.4.15)
|
||||||
array.prototype.flat: 1.3.2
|
array.prototype.flat: 1.3.2
|
||||||
|
File diff suppressed because one or more lines are too long
@ -6,6 +6,7 @@ import compression from "vite-plugin-compression";
|
|||||||
import { visualizer } from "rollup-plugin-visualizer";
|
import { visualizer } from "rollup-plugin-visualizer";
|
||||||
import { proxy } from "./src/config/proxy";
|
import { proxy } from "./src/config/proxy";
|
||||||
import { cool } from "@cool-vue/vite-plugin";
|
import { cool } from "@cool-vue/vite-plugin";
|
||||||
|
import { constants } from "crypto";
|
||||||
|
|
||||||
function resolve(dir: string) {
|
function resolve(dir: string) {
|
||||||
return path.resolve(__dirname, ".", dir);
|
return path.resolve(__dirname, ".", dir);
|
||||||
@ -58,6 +59,7 @@ export default ({ mode }: ConfigEnv): UserConfig => {
|
|||||||
esbuild: {
|
esbuild: {
|
||||||
drop: isDev(mode) ? [] : ["console", "debugger"]
|
drop: isDev(mode) ? [] : ["console", "debugger"]
|
||||||
},
|
},
|
||||||
|
|
||||||
build: {
|
build: {
|
||||||
minify: "esbuild",
|
minify: "esbuild",
|
||||||
// terserOptions: {
|
// terserOptions: {
|
||||||
@ -75,13 +77,17 @@ export default ({ mode }: ConfigEnv): UserConfig => {
|
|||||||
manualChunks(id) {
|
manualChunks(id) {
|
||||||
if (id.includes("node_modules")) {
|
if (id.includes("node_modules")) {
|
||||||
if (!["@cool-vue/crud"].find((e) => id.includes(e))) {
|
if (!["@cool-vue/crud"].find((e) => id.includes(e))) {
|
||||||
let str = id.toString().split("node_modules/")[1];
|
if (id.includes("prettier")) {
|
||||||
|
return;
|
||||||
if (str[0] == "@") {
|
|
||||||
str = str.replace("/", ".");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return str.split("/")[0].toString();
|
return id
|
||||||
|
.toString()
|
||||||
|
.split("node_modules/")[1]
|
||||||
|
.replace(".pnpm/", "")
|
||||||
|
.split("/")[0];
|
||||||
|
} else {
|
||||||
|
return "comm";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user