File tree Expand file tree Collapse file tree 6 files changed +1970
-4
lines changed
__snapshots__/test/generated/v3_no_index Expand file tree Collapse file tree 6 files changed +1970
-4
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ ' @hey-api/openapi-ts ' : patch
3
+ ---
4
+
5
+ fix: add ability to skip generating index file with output.indexFile
Original file line number Diff line number Diff line change @@ -143,7 +143,11 @@ export const generateOutput = async ({ context }: { context: IR.Context }) => {
143
143
continue ;
144
144
}
145
145
146
- if ( ! file . isEmpty ( ) && file . exportFromIndex ) {
146
+ if (
147
+ ! file . isEmpty ( ) &&
148
+ file . exportFromIndex &&
149
+ context . config . output . indexFile
150
+ ) {
147
151
// TODO: parser - add export method for more granular control over
148
152
// what's exported so we can support named exports
149
153
indexFile . add (
@@ -156,6 +160,8 @@ export const generateOutput = async ({ context }: { context: IR.Context }) => {
156
160
file . write ( '\n\n' ) ;
157
161
}
158
162
159
- indexFile . write ( ) ;
163
+ if ( context . config . output . indexFile ) {
164
+ indexFile . write ( ) ;
165
+ }
160
166
}
161
167
} ;
Original file line number Diff line number Diff line change @@ -159,6 +159,7 @@ const getOutput = (userConfig: ClientConfig): Config['output'] => {
159
159
let output : Config [ 'output' ] = {
160
160
clean : true ,
161
161
format : false ,
162
+ indexFile : true ,
162
163
lint : false ,
163
164
path : '' ,
164
165
} ;
Original file line number Diff line number Diff line change @@ -170,6 +170,14 @@ export interface ClientConfig {
170
170
* @default false
171
171
*/
172
172
format ?: Formatters | false ;
173
+ /**
174
+ * Should the exports from plugin files be re-exported in the index
175
+ * barrel file? By default, this is enabled and only default plugins
176
+ * are re-exported.
177
+ *
178
+ * @default true
179
+ */
180
+ indexFile ?: boolean ;
173
181
/**
174
182
* Process output folder with linter?
175
183
*
You can’t perform that action at this time.
0 commit comments