feat(cli): add overridable parameter to override component.files in getDirComponentURL

This commit is contained in:
p-sw 2024-06-15 03:37:28 +09:00
parent 76e2866bc9
commit e9c7281c33

View File

@ -29,8 +29,9 @@ export async function getComponentURL(
export async function getDirComponentURL(
registry: Registry,
component: RegistryComponent & {type: 'dir'},
files?: string[],
): Promise<string[]> {
const base = registry.base + registry.paths.components.replace('{componentName}', component.name)
return component.files.map((filename) => base + '/' + filename)
return (files ?? component.files).map((filename) => base + '/' + filename)
}