fix(nuxt3): ensure import names are unique

This commit is contained in:
Daniel Roe 2022-04-14 15:58:05 +01:00
parent 23a7db2a59
commit 5fef9e8db2

View File

@ -270,7 +270,7 @@ function hasSuffix (path: string, suffix: string) {
}
export function getImportName (name: string) {
return pascalCase(name).replace(/[^\w]/g, '')
return pascalCase(name).replace(/[^\w]/g, r => '_' + r.charCodeAt(0))
}
function uniqueBy <T, K extends keyof T> (arr: T[], key: K) {