-
Notifications
You must be signed in to change notification settings - Fork 12.5k
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
Relax import/export elision rules for separate compilation #2550
Conversation
// Parse | ||
var inputFileName = fileName || "module.ts"; | ||
var sourceFile = ts.createSourceFile(inputFileName, input, options.target); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
u do not need the ts
looks good. We just need a unit test. |
thanks! 👍 |
Relax import/export elision rules for separate compilation
I just tried Visual Studio Code, it can't emit single files on save. Is this required for it to be able to do it? The Atom-Typescript can do it on save, which is a huge plus, but it doesn't use TSC for that. Edit Just noticed this is "merged", somehow I saw this as open. |
Compile on save is not supported yet. I would recommend starting the compiler with --watch; this should give you the same effect. Also I wopd recommend using tsconfig with this setting to get consistent experience between the ide and command line and run the compiler from the folder with tsconfig.json as:
Also pinging @jrieken from vs code to comment on compile on save. |
This PR adds a new compiler option: separateCompilation that should be used when we compile one file at a time. In this mode when some name is not resolved (and thus is
unknownSymbol
) we conservatively assume that this name can possibly refer to a value and do not elide imports/exportes that use this name.Also I've added
transpile
function that can be used i.e. from es6-module-loader to get the emit result for one file