Skip to content
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

test: should resolve .ts from .js alias #213

Closed
wants to merge 1 commit into from

Conversation

aleclarson
Copy link
Contributor

This test confirms a bug reported in aleclarson/vite-tsconfig-paths#54

TypeScript allows importing a TypeScript module using a .js extension, and a .jsx extension for TSX modules.

@MichaelDeBoey
Copy link
Contributor

@F3n67u Is this related to #199? 🤔

},
existingFiles: [join("/root", "src", "foo.ts")],
requestedModule: "@/foo.js",
expectedPath: join("/root", "src", "foo.ts"),
Copy link
Contributor

@IgnusG IgnusG Jul 20, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will your resolution work if the path is selected as follows?

Suggested change
expectedPath: join("/root", "src", "foo.ts"),
expectedPath: join("/root", "src", "foo"),

If so #216 would address it as well - otherwise it does not.

@aleclarson
Copy link
Contributor Author

Closed in favor of #216

@aleclarson aleclarson closed this Oct 12, 2022
jonaskello pushed a commit that referenced this pull request Jun 2, 2023
* Fix missing paths when using typescript's module nodenext feature

This resolution requires relative/mapped import paths to end with .js

Reference https://devblogs.microsoft.com/typescript/announcing-typescript-4-5-beta/#esm-nodejs

* Add tests from #213

#213

* Add support for .mjs, .cjs and .jsx files
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants