-
-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add extensions to imports #7
base: main
Are you sure you want to change the base?
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