File tree Expand file tree Collapse file tree 2 files changed +8
-14
lines changed Expand file tree Collapse file tree 2 files changed +8
-14
lines changed Original file line number Diff line number Diff line change @@ -215,7 +215,10 @@ export class Context {
215
215
Array
216
216
. from ( this . _componentPaths )
217
217
. forEach ( ( path ) => {
218
- const name = pascalCase ( getNameFromFilePath ( path , this . options ) )
218
+ const fileName = getNameFromFilePath ( path , this . options )
219
+ const name = this . options . prefix
220
+ ? `${ pascalCase ( this . options . prefix ) } ${ pascalCase ( fileName ) } `
221
+ : pascalCase ( fileName )
219
222
if ( isExclude ( name , this . options . excludeNames ) ) {
220
223
debug . components ( 'exclude' , name )
221
224
return
Original file line number Diff line number Diff line change @@ -38,16 +38,6 @@ export function parseDeclaration(code: string): DeclarationImports | undefined {
38
38
return imports
39
39
}
40
40
41
- function addComponentPrefix ( component : ComponentInfo , prefix ?: string ) {
42
- if ( ! component . as || ! prefix )
43
- return component
44
-
45
- return {
46
- ...component ,
47
- as : `${ prefix } ${ component . as } ` ,
48
- }
49
- }
50
-
51
41
/**
52
42
* Converts `ComponentInfo` to an array
53
43
*
@@ -82,10 +72,11 @@ export interface DeclarationImports {
82
72
}
83
73
84
74
export function getDeclarationImports ( ctx : Context , filepath : string ) : DeclarationImports | undefined {
85
- const prefixComponentNameMap = Object . values ( ctx . componentNameMap ) . map ( info => addComponentPrefix ( info , ctx . options . prefix ) )
86
75
const component = stringifyComponentsInfo ( filepath , [
87
- ...Object . values ( ctx . componentCustomMap ) ,
88
- ...prefixComponentNameMap ,
76
+ ...Object . values ( {
77
+ ...ctx . componentNameMap ,
78
+ ...ctx . componentCustomMap ,
79
+ } ) ,
89
80
...resolveTypeImports ( ctx . options . types ) ,
90
81
] , ctx . options . importPathTransform )
91
82
You can’t perform that action at this time.
0 commit comments