The —preserveSymlinks compiler flag
TypeScript 2.5 brings the preserveSymlinks
flag, which parallels the behavior of the —preserve-symlinks
flag in Node.js.This flag also exhibits the opposite behavior to Webpack’s resolve.symlinks
option (i.e. setting TypeScript’s preserveSymlinks
to true
parallels setting Webpack’s resolve.symlinks
to false
, and vice-versa).
In this mode, references to modules and packages (e.g. import
s and /// <reference type="…" />
directives) are all resolved relative to the location of the symbolic link file, rather than relative to the path that the symbolic link resolves to.For a more concrete example, we’ll defer to the documentation on the Node.js website.