mirror of
https://github.com/movie-web/movie-web.git
synced 2024-12-27 00:36:05 +00:00
More bundling improvements
This commit is contained in:
parent
bbf5645c2b
commit
68538d2112
|
@ -11,6 +11,15 @@ import { loadEnv, splitVendorChunkPlugin } from "vite";
|
|||
import tailwind from "tailwindcss";
|
||||
import rtl from "postcss-rtlcss";
|
||||
|
||||
const captioningPackages = [
|
||||
"dompurify",
|
||||
"htmlparser2",
|
||||
"subsrt-ts",
|
||||
"parse5",
|
||||
"entities",
|
||||
"fuse"
|
||||
];
|
||||
|
||||
export default defineConfig(({ mode }) => {
|
||||
const env = loadEnv(mode, process.cwd());
|
||||
return {
|
||||
|
@ -119,8 +128,18 @@ export default defineConfig(({ mode }) => {
|
|||
if (id.includes("hls.js")) {
|
||||
return "hls";
|
||||
}
|
||||
if (id.includes("node-forge")) {
|
||||
return "node-forge";
|
||||
if (id.includes("node-forge") || id.includes("crypto-js")) {
|
||||
return "auth";
|
||||
}
|
||||
if (id.includes("locales") && !id.includes("en.json")) {
|
||||
return "locales";
|
||||
}
|
||||
if (id.includes("Icon.tsx")) {
|
||||
return "Icons";
|
||||
}
|
||||
const isCaptioningPackage = captioningPackages.some(packageName => id.includes(packageName));
|
||||
if (isCaptioningPackage) {
|
||||
return "caption-parsing";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue