Skip to content
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

Usage of TypeScript compiler as a library #1550

Closed
bripkens opened this issue Dec 23, 2014 · 1 comment
Closed

Usage of TypeScript compiler as a library #1550

bripkens opened this issue Dec 23, 2014 · 1 comment
Labels
Duplicate An existing issue was already created Suggestion An idea for TypeScript

Comments

@bripkens
Copy link

Tool development could be simplified when the TypeScript compiler could be used as a library. The compiler currently does not check whether it is executed as a library (see tsc.ts).

To enable usage as a library the compiler could check whether it is executed as the main module. In addition, the ts variable should be exported. By doing this, module like typescript-api would become obsolete and tool development (like Browserify and Webpack integrations) would be easier.

@DanielRosenwasser
Copy link
Member

We don't support consuming the compiler outright (i.e. using anything within tsc.ts), but we will support using it as an NPM module - see instructions on #372.

It's basically as simple as:

import ts = require("typescript");

@DanielRosenwasser DanielRosenwasser added Duplicate An existing issue was already created Fixed A PR has been merged for this issue Suggestion An idea for TypeScript labels Dec 23, 2014
@RyanCavanaugh RyanCavanaugh removed the Fixed A PR has been merged for this issue label Jan 8, 2015
@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
Duplicate An existing issue was already created Suggestion An idea for TypeScript
Projects
None yet
Development

No branches or pull requests

3 participants