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

Add .js extension to imports to support ES Modules

Open macalinao opened this issue 3 years ago • 7 comments

See: https://nodejs.org/api/esm.html#mandatory-file-extensions

macalinao avatar Aug 26 '22 12:08 macalinao

Hey @ferdikoomen 👋 any objections to merging this? We're also depending on this PR. Thanks!

asafkotzer avatar Sep 20 '22 08:09 asafkotzer

How are you consuming the output, inside a nodeJS application? Because the requirement to have .js inside imports is a Node specific issue, maybe we should limit these changes to the nodeJS client (or have it as a build flag?) Right now it throws all kinds of import warnings on older / bundled / browser based projects

ferdikoomen avatar Oct 28 '22 08:10 ferdikoomen

any progress?

https://github.com/ferdikoomen/openapi-typescript-codegen/issues/1381

bulolo avatar Dec 29 '22 16:12 bulolo

Is there something stopping this from being merged? Blocking our adoption atm

winterrobert avatar May 26 '23 07:05 winterrobert

I'm very interested in this as well

svenheden avatar Jun 30 '23 08:06 svenheden

so are we. we use this package to create an isomorphic api client and so being able to use node esm resolution would be nice.

sam-mfb avatar Jul 06 '23 21:07 sam-mfb

What issue are you trying to solve here? I fail to see how this will solve anything, as it is just a PR (with no issue connected describing what the problem is). What we have is a link to an ESM page, as if that was enough, but this project is not an ESM project.

What we really want is a solution to this issue #1182 right?

klippx avatar Jul 18 '23 09:07 klippx