Skip to content

Adds 'lib' reference directives - #23893

Merged
Ron Buckton (rbuckton) merged 16 commits into
masterfrom
libReference
Jun 4, 2018
Merged

Ron Buckton (rbuckton) merged 16 commits into
masterfrom
libReference

Conversation

@rbuckton

Copy link
Copy Markdown
Contributor

This change adds support for a /// <reference lib="name" /> directive, allowing a file to explicitly include an existing built-in lib file.

  • When a built-in lib is referenced via the lib reference directive, any no-default-lib reference directive in the lib file is ignored. This is so that a lib reference in an imported package won't cause your current project to lose its default lib if you haven't specified one.
  • Built-in lib files are referenced in the same fashion as the "lib" compiler option in tsconfig.json (e.g. use lib="es2015" and not lib="lib.es2015.d.ts", etc.).

In the long term this can help polyfill/shim packages like core-js or es6-shim.

NOTE: Apparently we were very close to running out of heap memory when running gulp tests after running gulp clean as gulp is holding onto too much memory. Individually each task is fine, but in concert they add up to a large amount of uncollected memory. To address this, I've added a script to run some of our builds out-of-process. This is not an issue in the jake builds.

Fixes #15732.
Supersedes #15780

Loading
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Suggestion: Add "lib" reference directive

7 participants