-
Notifications
You must be signed in to change notification settings - Fork 621
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 typescript into deno_std #428
Comments
@ry and talked about this... it makes sense... largely we need a CompilerHost that works well under Deno, which would be similar to what we use in the built in Deno compiler (possibly to become the host). I am going to be taking a look at it, but anyone else wanting to help would be glad to talk about what needs to be done. |
As a very first pass, I think just having a test that loads TS and checked the version (or some other basic thing) would be sufficient. |
For anyone interested, the "trick" is that So we need to combine the So something like this: // @deno-types="./vendor/typescript.d.ts"
import "./vendor/typescript.js";
import * as ts_ from "./vendor/typescript.d.ts";
declare global {
namespace ts {
export = ts_;
}
} |
@ry I have it mostly working with the following (with the couple recent patches I made to deno master): // @deno-types="./vendor/typescript.d.ts"
import "./vendor/typescript.js";
import * as ts_ from "./vendor/typescript.d.ts";
declare global {
// eslint-disable-next-line @typescript-eslint/no-namespace
namespace ts {
// @ts-ignore
export = ts_;
}
} But the problem is that we load everything as a module into the isolate at runtime, which means that the global |
Yes, it's built into deno, but it's difficult to access from the special snapshot where it's stored.
It would be nice to have access to typescript in 3rd party code. So the easy solution is to just import it in here.
The text was updated successfully, but these errors were encountered: