Skip to content

Commit c3b8c4f

Browse files
committed
fix: log warning
1 parent 94376a6 commit c3b8c4f

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

  • packages/openapi-code-generator/src

packages/openapi-code-generator/src/index.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,15 @@ export async function generate(
7676
allowUnusedImports: config.allowUnusedImports,
7777
})
7878

79+
if (
80+
config.tsIsEsmProject &&
81+
!config.tsCompilerOptions.rewriteRelativeImportExtensions
82+
) {
83+
logger.warn(
84+
`Generating in ESM mode, but typescript compiler option "rewriteRelativeImportExtensions" is not set to true. This may result in broken imports.`,
85+
)
86+
}
87+
7988
await generator.run({
8089
input,
8190
emitter,

0 commit comments

Comments
 (0)