-
-
Notifications
You must be signed in to change notification settings - Fork 6.3k
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
Import without .vue extension in ts files #5307
Comments
Yeah. I'm not sure how to support this use case with the current ts-loader functionalities. It's a type-checking error than a real compilation error because the TypeScript compiler does not support custom file extensions. We worked around this limitation by appending the But if you don't specify a file extension, there would be much logic to calculate to decide whether a |
I see.. sad.
@sodatea |
I'm not sure actually. /cc @HerringtonDarkholme Do you have any idea on how to support this use case? |
@sodatea @l00k You probably need to change ts-loader's source code to make ts-loader recognize vue file without extension. My suggestion would be start by hacking ts-loader's resolveModule function https://github.com/TypeStrong/ts-loader/blob/ce39c25a00641cb708efcd2e31556cb3f7afa771/src/servicesHost.ts#L768-L776. |
Thanks. |
You need to install |
Version
4.2.3
Reproduction link
https://github.com/l00k/sample-vue-issue
Environment info
Steps to reproduce
npm run serve
What is expected?
I should be possible to import without .vue extension in path
What is actually happening?
Errors in
src/tests/test-ts-import-noext.vue(3,20)
src/tests/test2-import-noext.ts(2,20)
while importing without vue extension
Note other tests (src/tests)
Is is issue with ts-loader?
The text was updated successfully, but these errors were encountered: