What does tsconfig.json's references.path.prepend do?

Viewed 168

I don't understand the official documentation of what prepend does, even though I understand everything up to this point:

enter image description here

The second paragraph is what confuses me.

Prepending a project will include the project’s output above the output of the current project. All output files (.js, .d.ts, .js.map, .d.ts.map) will be emitted correctly.

  1. I don't understand these two sentences at all. Can someone word them in a different way?
  2. I'd like to see an example showing the difference between prepend: true vs prepend: false / undefined.
  3. I'd like to see an example showing the difference between prepend: true with outFile set vs unset. It's an error to use prepend without outFile set.

Partial answer:

Based on my discovery re: #3, I've deduced what prepend does (probably).

./
  foo/
    tsconfig.json
  bar/
    tsconfig.json

If foo's tsconfig.json references ../bar with prepend: true, then ../bar's outFile will be prepended to foo's outFile.

Not sure what'll happen if prepend is off in the same scenario. I assume there'll be two output files, but I don't know how the load order would be determined.

0 Answers
Related