Fix bundle names for packages under namespaces
This commit is contained in:
parent
f3f3edeb00
commit
982fd65bd0
1 changed files with 8 additions and 0 deletions
|
@ -105,6 +105,14 @@ const config = {
|
||||||
// get the name. E.g. node_modules/packageName/not/this/part.js
|
// get the name. E.g. node_modules/packageName/not/this/part.js
|
||||||
// or node_modules/packageName
|
// or node_modules/packageName
|
||||||
const packageName = module.context.match(/[\\/]node_modules[\\/](.*?)([\\/]|$)/)[1];
|
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}`;
|
return `node_modules.${packageName}`;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue