1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

Fix bundle names for packages under namespaces

This commit is contained in:
Bill Thornton 2022-10-12 10:24:05 -04:00
parent f3f3edeb00
commit 982fd65bd0

View file

@ -105,6 +105,14 @@ const config = {
// get the name. E.g. node_modules/packageName/not/this/part.js
// or node_modules/packageName
const packageName = module.context.match(/[\\/]node_modules[\\/](.*?)([\\/]|$)/)[1];
// if "packageName" is a namespace (i.e. @jellyfin) get the namespace + packageName
if (packageName.startsWith('@')) {
const parts = module.context
.substring(module.context.lastIndexOf(packageName))
.split('/');
return `node_modules.${parts[0]}.${parts[1]}`;
}
return `node_modules.${packageName}`;
}
}