swagger-typescript-api icon indicating copy to clipboard operation
swagger-typescript-api copied to clipboard

Generate an index file when using modular mode

Open llott7 opened this issue 2 years ago • 2 comments

I want to use Modular mode, but it doesn't generate an index file to mass-export stuff. Rather than being able to do import { Thing, ThingDto } from 'api';, I'm forced to use multiple import statements, import { Thing } from 'api/Thing'; import { ThingDto } from 'api/data-contracts';

Is it possible to have this generate an index.ts file? If not a cli argument, then is it possible to have the modular templates generate a single extra file, such that each module can write to it once?

Thanks.

llott7 avatar Apr 26 '23 16:04 llott7

Also wondering about this.

Isola92 avatar Oct 25 '23 11:10 Isola92

In node config, you may customize it and share here fs.appendFileSync(configuration.config.output + "/index.ts", 'export * from "./' + fileName + '";\n');

fortyone-41 avatar Jan 25 '24 08:01 fortyone-41