From 0a747c7a1b863aef5a4aa0dd5b8a662fb7024165 Mon Sep 17 00:00:00 2001 From: Shodai Suzuki Date: Thu, 28 Dec 2023 21:33:53 +0900 Subject: [PATCH] fix(core): Fixed condition for using `barrel` import in `split-tags` mode (#1122) --- packages/core/src/writers/split-tags-mode.ts | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/packages/core/src/writers/split-tags-mode.ts b/packages/core/src/writers/split-tags-mode.ts index 171b6efba..294d9e8f0 100644 --- a/packages/core/src/writers/split-tags-mode.ts +++ b/packages/core/src/writers/split-tags-mode.ts @@ -53,12 +53,13 @@ export const writeSplitTagsMode = async ({ upath.relativeSafe(dirname, getFileInfo(output.schemas).dirname) : '../' + filename + '.schemas'; - const importsForBuilder = output.schemas - ? uniqBy(imports, 'name').map((i) => ({ - exports: [i], - dependency: upath.join(relativeSchemasPath, camel(i.name)), - })) - : [{ exports: imports, dependency: relativeSchemasPath }]; + const importsForBuilder = + output.schemas && !output.indexFiles + ? uniqBy(imports, 'name').map((i) => ({ + exports: [i], + dependency: upath.join(relativeSchemasPath, camel(i.name)), + })) + : [{ exports: imports, dependency: relativeSchemasPath }]; implementationData += builder.imports({ client: output.client,