-
-
Notifications
You must be signed in to change notification settings - Fork 433
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
[Compiler Options] Account for allowJs
compiler option
#316
Comments
Thanks for raising this issue @dschnare - if it's as simple as that (and it may well be) then I'd like to include this in a future release. If you get the chance to dig into this we'd greatly appreciate a PR. |
Actually I may look at this myself- fixing this as it may well resolve #278 |
Hi @dschnare, I'm planning to release a version of ts-loader that includes your suggested fix. Would you be able to supply me with a repo that demostrates the problem when this is not available? Try as I might I've struggled to reproduce the problem myself. js modules seem to be resolved no matter what.... which is odd. Either way, I'd like to ensure that I have a test to cover this in terms of preventing regressions. If you could help that'd be great. |
Hey John, It seems to occur when the entry point module is a JS file. It also On Oct 16, 2016 3:08 PM, "John Reilly" notifications@github.com wrote:
|
Funny - I couldn't get that not to work! I will look forward to the repo and look to add / amend tests accordingly 👍 Thanks chap! Just readying the 0.9.3 release now which adds |
@johnnyreilly version 0.9.3 resolved the issue I was having. I have pushed up a repo that still uses 0.9.2 and can demonstrate the issue. Steps to reproduce:
The |
Excellent - thanks! |
Great - I've used your repo to make a some better allowJs tests: #325 |
This issue has been re-introduced in version 1.3.3. |
Currently, even though the
allowJs
compiler option has been defined in atsconfig.json
or via thets.compilerOptions
config, JavaScript modules will not be found. I have resolved this issue, at least for my needs, by changing line 95 inindex.ts
.Original:
const scriptRegex = /\.tsx?$/i;
Changed:
const scriptRegex = /\.[jt]sx?$/i;
I haven't ran into any issues yet. If anyone has time to fully test this use case out. I would greatly appreciate your efforts. I currently don't have time to dig into this for a few weeks. There may other cases in the source code where the file extension match needs to take into account the
allowJs
option as well.The text was updated successfully, but these errors were encountered: