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
Typescript: importing with /// <reference path="" /> doesn't work #252
Comments
/// <reference path="b.ts" />
b; so the error is expected. In order to import a module you may use /// <reference path="b.ts" />
import './b'
b; |
No, that's not true. Depending on how you have your tsconfig configured, it's possible that TypeScript will concatenate all your source files into a single file (if you use outFile). While it's probably unreasonable to expect quokka to compile every file (even though that is what TS does), it would be nice if reference paths hinted quokka to concatenate the two files together. Unfortunately imports are not always possible - some projects use outFile and imports will confuse that. |
It's only the case if you run TypeScript for the whole project, however I specifically mentioned the scenario when
Fair enough, re-opening as a feature request. |
If you want to be pedantic, there is no such thing as "single file compilation" in a project with outFile set. It's all or nothing 😉 But yea, seeing this sort of thing would be nice. I actually already bought quokka half with the expectation that this would work (the "try pro" wasn't working for some reason), if that motivates you at all, hehe. |
Issue description or question
When I use Quokka.js on a TypeScript file, if it has /// references, quokka won't know to pull in those files, meaning it can't resolve any objects in external files.
Sample code
a.ts
b.ts
Quokka.js Console Output
b is not defined
Code editor version
Visual Studio Code v1.27.1
OS name and version
macOS high sierra
The text was updated successfully, but these errors were encountered: