Add extensions to imports#7
Conversation
Update index.ts
Update icons.ts
|
I'm not sure how this PR will produce working code...the files ARE typescript files, and do not have a |
|
Also, it seems irrelevant, because our bundle produces a single https://www.npmjs.com/package/@phosphor-icons/core?activeTab=code |
|
I have not had problems using |
|
Thanks for the reply, I'll try and address all of the points: The other reason this is important is because somebody wishing to consume she source files in there project (thing having this as a submodule and not a npm dependancy) will also be scoped out of using ESM. |
|
I don't follow...if you're using the source, then you're using TypeScript, and you don't need the extensions. If you're not using the source, then there are single-file bundles for ESM and CJS. I'm curious to see how you're using it that is not working? |
|
One specific example is when using |
|
If you have a specific issue you can point me to to test and see the failure with my own eyes, I'd appreciate it. I am struggling to understand when and what would fail, and I have never seen anyone write Typescript code referencing Typescript code by a .js extension. |
|
I'll prep an example when I have time, but this is some reading on the topic and should convey the reasoning (this also applies for .d.ts files) |
As per the Node ESM spec, file extensions are always required for relative imports, ref: https://nodejs.org/api/esm.html#terminology
I'm working on a better solidjs solution and this is currently a blocker for me