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

Add --import compiler options to specify module imports that should happen for every module. #2911

Closed
rbuckton opened this issue Apr 24, 2015 · 2 comments
Labels
In Discussion Not yet reached consensus Suggestion An idea for TypeScript

Comments

@rbuckton
Copy link
Member

The --import compiler option can be specified multiple times on the command line, or would be a string array in tsconfig.json. Its argument is a module name which would be imported at the top of every external module in the project.

For example, the following command line:

tsc app.ts --import module

Would be the equivalent of:

// app.ts
import "module";

The named module will be resolved in the same way the above import declaration's module would be resolved, so the module name must either be declared as an ambient external module or resolve to a valid path relative to each external module in the list of sources, unless that would mean importing itself.

This is to support loading an external library of TypeScript helper functions as well as various polyfill and shim libraries.

@rbuckton rbuckton added the Suggestion An idea for TypeScript label Apr 24, 2015
@mhegazy
Copy link
Contributor

mhegazy commented Apr 24, 2015

related to #2901

@mhegazy mhegazy added the In Discussion Not yet reached consensus label Dec 9, 2015
@RyanCavanaugh
Copy link
Member

Doesn't seem like we need this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
In Discussion Not yet reached consensus Suggestion An idea for TypeScript
Projects
None yet
Development

No branches or pull requests

3 participants