Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions tsc/internal/compiler/filesparser.go
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,8 @@ func (w *filesParser) start(loader *fileLoader, tasks []*parseTask, depth int) {
}

currentDepth := core.IfElse(task.increaseDepth, depth+1, depth)
if currentDepth < data.lowestDepth {
lowered := currentDepth < data.lowestDepth
if lowered {
// If we're seeing this task at a lower depth than before,
// reprocess its subtasks to ensure they are loaded.
data.lowestDepth = currentDepth
Expand All @@ -324,7 +325,7 @@ func (w *filesParser) start(loader *fileLoader, tasks []*parseTask, depth int) {
data.startedSubTasks = true
}
}
if !taskByFileName.startedSubTasks && loadSubTasks {
if loadSubTasks && (lowered || !taskByFileName.startedSubTasks) {
taskByFileName.startedSubTasks = true
w.start(loader, taskByFileName.subTasks, data.lowestDepth)
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
//// [tests/cases/compiler/symlinkedPackageReachedRelativelyIsNotExternalLibrary.ts] ////

//// [package.json]
{ "name": "lib", "types": "index.ts" }

//// [index.ts]
export { util } from "./util";

//// [util.ts]
export const util = 1;

//// [a.ts]
import { util } from "./lib/index";
export const a = util;

//// [b.ts]
import { util } from "lib";
export const b = util;


//// [util.js]
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.util = void 0;
exports.util = 1;
//// [index.js]
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.util = void 0;
var util_1 = require("./util");
Object.defineProperty(exports, "util", { enumerable: true, get: function () { return util_1.util; } });
//// [a.js]
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.a = void 0;
const index_1 = require("./lib/index");
exports.a = index_1.util;
//// [b.js]
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.b = void 0;
const lib_1 = require("lib");
exports.b = lib_1.util;
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
// @noTypesAndSymbols: true

// @filename: /src/tsconfig.json
{
"compilerOptions": { "outDir": "out", "module": "commonjs", "target": "es2015" },
"files": ["a.ts", "b.ts"]
}

// @filename: /src/a.ts
import { util } from "./lib/index";
export const a = util;

// @filename: /src/b.ts
import { util } from "lib";
export const b = util;

// @filename: /src/lib/package.json
// @symlink: /src/node_modules/lib/package.json
{ "name": "lib", "types": "index.ts" }

// @filename: /src/lib/index.ts
// @symlink: /src/node_modules/lib/index.ts
export { util } from "./util";

// @filename: /src/lib/util.ts
// @symlink: /src/node_modules/lib/util.ts
export const util = 1;
Loading