diff --git a/packages/ts/generator-typescript-plugin-subtypes/src/index.ts b/packages/ts/generator-typescript-plugin-subtypes/src/index.ts index f78ee4e80c..4f3d64fc79 100644 --- a/packages/ts/generator-typescript-plugin-subtypes/src/index.ts +++ b/packages/ts/generator-typescript-plugin-subtypes/src/index.ts @@ -52,6 +52,10 @@ export default class SubTypesPlugin extends Plugin { }); } }); + + const unionFn = `${convertFullyQualifiedNameToRelativePath(baseKey)}Union.ts`; + const unionSource = sources.find(({ fileName }) => fileName === unionFn)!; + sources.splice(sources.indexOf(unionSource), 1); } }); } diff --git a/packages/ts/generator-typescript-plugin-subtypes/test/push-type/SubTypes.spec.ts b/packages/ts/generator-typescript-plugin-subtypes/test/push-type/SubTypes.spec.ts index be43af5bc6..2fa0e01fdd 100644 --- a/packages/ts/generator-typescript-plugin-subtypes/test/push-type/SubTypes.spec.ts +++ b/packages/ts/generator-typescript-plugin-subtypes/test/push-type/SubTypes.spec.ts @@ -17,7 +17,7 @@ describe('SubTypesPlugin', () => { const generator = createGenerator([BackbonePlugin, ModelPlugin, SubTypesPlugin]); const input = await loadInput(sectionName, import.meta.url); const files = await generator.process(input); - expect(files.length).to.equal(11); + expect(files.length).to.equal(10); const t = await files[1].text(); expect(t).to.exist;