mirror of
https://github.com/sussy-code/smov.git
synced 2024-12-20 14:37:43 +01:00
More bundling improvements
This commit is contained in:
parent
bbf5645c2b
commit
68538d2112
1 changed files with 21 additions and 2 deletions
|
@ -11,6 +11,15 @@ import { loadEnv, splitVendorChunkPlugin } from "vite";
|
||||||
import tailwind from "tailwindcss";
|
import tailwind from "tailwindcss";
|
||||||
import rtl from "postcss-rtlcss";
|
import rtl from "postcss-rtlcss";
|
||||||
|
|
||||||
|
const captioningPackages = [
|
||||||
|
"dompurify",
|
||||||
|
"htmlparser2",
|
||||||
|
"subsrt-ts",
|
||||||
|
"parse5",
|
||||||
|
"entities",
|
||||||
|
"fuse"
|
||||||
|
];
|
||||||
|
|
||||||
export default defineConfig(({ mode }) => {
|
export default defineConfig(({ mode }) => {
|
||||||
const env = loadEnv(mode, process.cwd());
|
const env = loadEnv(mode, process.cwd());
|
||||||
return {
|
return {
|
||||||
|
@ -119,8 +128,18 @@ export default defineConfig(({ mode }) => {
|
||||||
if (id.includes("hls.js")) {
|
if (id.includes("hls.js")) {
|
||||||
return "hls";
|
return "hls";
|
||||||
}
|
}
|
||||||
if (id.includes("node-forge")) {
|
if (id.includes("node-forge") || id.includes("crypto-js")) {
|
||||||
return "node-forge";
|
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