feat: manual classify build file

This commit is contained in:
AkagiYui 2024-05-09 23:35:14 +08:00
parent 4739c121c6
commit 238377e619
3 changed files with 24 additions and 1 deletions

View File

Before

Width:  |  Height:  |  Size: 437 KiB

After

Width:  |  Height:  |  Size: 437 KiB

View File

@ -306,7 +306,7 @@ const selectedTab = ref("signin")
}
.background {
background-image: url("/images/background.webp");
background-image: url("/img/background.webp");
background-size: cover;
background-position: center top;
opacity: 1;

View File

@ -79,6 +79,29 @@ const config = {
return "module-" + name.split("@")[0]
}
},
entryFileNames: "js/[name]-[hash].js",
chunkFileNames: "js/[name]-[hash].js",
assetFileNames(chunkInfo: any) {
if (chunkInfo.name.endsWith(".css")) {
return "css/[name]-[hash][extname]"
}
if (chunkInfo.name.endsWith(".js")) {
return "js/[name]-[hash][extname]"
}
const imgExts = [
".png",
".jpg",
".jpeg",
".gif",
".svg",
".webp",
".ico",
]
if (imgExts.some((ext) => chunkInfo.name.endsWith(ext))) {
return "img/[name]-[hash][extname]"
}
return "assets/[name]-[hash][extname]"
},
},
},
},