File tree 1 file changed +9
-1
lines changed
packages/core/src/writers
1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ import {
11
11
import { generateTargetForTags } from './target-tags' ;
12
12
import { getOrvalGeneratedTypes } from './types' ;
13
13
import { getMockFileExtensionByTypeName } from '../utils/fileExtensions' ;
14
+ import uniqBy from 'lodash.uniqby' ;
14
15
15
16
export const writeSplitTagsMode = async ( {
16
17
builder,
@@ -52,10 +53,17 @@ export const writeSplitTagsMode = async ({
52
53
upath . relativeSafe ( dirname , getFileInfo ( output . schemas ) . dirname )
53
54
: '../' + filename + '.schemas' ;
54
55
56
+ const importsForBuilder = output . schemas
57
+ ? uniqBy ( imports , 'name' ) . map ( ( i ) => ( {
58
+ exports : [ i ] ,
59
+ dependency : upath . join ( relativeSchemasPath , camel ( i . name ) ) ,
60
+ } ) )
61
+ : [ { exports : imports , dependency : relativeSchemasPath } ] ;
62
+
55
63
implementationData += builder . imports ( {
56
64
client : output . client ,
57
65
implementation,
58
- imports : [ { exports : imports , dependency : relativeSchemasPath } ] ,
66
+ imports : importsForBuilder ,
59
67
specsName,
60
68
hasSchemaDir : ! ! output . schemas ,
61
69
isAllowSyntheticDefaultImports,
You can’t perform that action at this time.
0 commit comments