openapi-typescript-codegen icon indicating copy to clipboard operation
openapi-typescript-codegen copied to clipboard

Add option to use ESM style import specifiers

Open Awem opened this issue 3 years ago • 1 comments

The code generated by this package is currently not suitable to be easily used in ESM projects. This is because for ESM, we need different import specifiers: https://nodejs.org/api/esm.html#import-specifiers

So e.g.:

export { ApiError } from './core/ApiError should be export { ApiError } from './core/ApiError.js

It would be helpful to provide a configuration option, that changes the generated code accordingly.

Awem avatar Aug 05 '22 11:08 Awem

Seems like #1226 is trying to fix this

Pustur avatar Sep 12 '22 10:09 Pustur