Skip to content

possibility to pipe output without creating temp files #2118

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

Closed
koutsenko opened this issue Feb 23, 2015 · 5 comments
Closed

possibility to pipe output without creating temp files #2118

koutsenko opened this issue Feb 23, 2015 · 5 comments
Labels
Question An issue which isn't directly actionable in code

Comments

@koutsenko
Copy link

Now compiler writes the output to disk only.
How can I compile .ts in memory?
I searched and found no results.

Thanks.

@danquirk
Copy link
Member

Are you looking for the compiler API to do this? https://github.com/Microsoft/TypeScript/wiki/Using-the-Compiler-API

Or is there some other scenario you have in mind?

@DanielRosenwasser
Copy link
Member

This is currently an issue tracked by #1226.

@DanielRosenwasser DanielRosenwasser added the Duplicate An existing issue was already created label Feb 23, 2015
@DanielRosenwasser
Copy link
Member

In addition to @danquirk's response, if you are looking to do intermediate processing, you can use our compiler API, or utilize something like typescript-simple which also uses our API.

Could you describe whether either of these sufficiently answers your question?

@DanielRosenwasser DanielRosenwasser removed the Duplicate An existing issue was already created label Feb 23, 2015
@koutsenko
Copy link
Author

It's just for build script written on pure node js script without any grunt, gulp and other trendy odd stuff.
TS->JS compilation result isn't the build process endpoint.
I want optimize result (Google Closure Compiler in advanced mode), then minify it.
So, transient disk writes slowing down the process a bit.

Seems I need to use compiler API and write customized CompilerHost.
Thanks for the answers and sorry for any inconveniences.

@danquirk danquirk added the Question An issue which isn't directly actionable in code label Feb 24, 2015
@DanielRosenwasser
Copy link
Member

In that case, you'd probably be able to get away with creating a default compiler host and overwriting the writeFile function. It actually shouldn't be terribly difficult to set up.

@microsoft microsoft locked and limited conversation to collaborators Jun 18, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Question An issue which isn't directly actionable in code
Projects
None yet
Development

No branches or pull requests

3 participants