Add .js Extensions to Imports statements
We need to evaluate whether to add .js extensions to import statements across all packages in this repository.
Verify the configuration of tsconfig. Depending on the options set, it can:
- Automatically add the missing
.jsextension or not. - Automatically add
indexor not.
Additionally, define the hows and whys of this process.
I noticed that the Kiota lib I generated (using V 1.27.0) there were quite a few imports statements pointing to .js files....that don't exist since the client generates .ts assets. I removed all then ".js" manually and the client built fine after that but it does seem like there's an issue here.
@EricAtMSFT the reason why kiota generates typescript code with a .js extension for all relative imports is because it's required by the ESM specification and its implementation through node/TypeScript. Let us know if you have any additional comments or questions.
@EricAtMSFT the reason why kiota generates typescript code with a .js extension for all relative imports is because it's required by the ESM specification and its implementation through node/TypeScript. Let us know if you have any additional comments or questions.
Hmm, this is the first I've learned of that. I haven't seen any library adhere to that standard. So in typescript, its invalid to use 'path/to/code'? Seems like it defeats the purpose of typescript to append ".js" to the end of every import.