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
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
# Changelog

## v9.2.8

* [Bug fix: support webpack 5 in ts-loader](https://github.com/TypeStrong/ts-loader/pull/1439) [#1438] - thanks @einatbar

## v9.2.7

* [cater for change in resolveTypeReferenceDirective API in TypeScript 4.7](https://github.com/TypeStrong/ts-loader/pull/1422) [#1421] - thanks @johnny_reilly and @cspotcode for inspiration in ts-node work here: https://github.com/TypeStrong/ts-node/pull/1648
* [cater for change in resolveTypeReferenceDirective API in TypeScript 4.7](https://github.com/TypeStrong/ts-loader/pull/1422) [#1421] - thanks @johnny_reilly and @cspotcode for inspiration in ts-node work here: https://github.com/TypeStrong/ts-node/pull/1648

## v9.2.6

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ts-loader",
"version": "9.2.7",
"version": "9.2.8",
"description": "TypeScript loader for webpack",
"main": "index.js",
"types": "dist",
Expand Down
51 changes: 26 additions & 25 deletions src/watch-run.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,34 +30,35 @@ export function makeWatchRun(
instance.reportTranspileErrors = true;
} else {
const times = compiler.fileTimestamps;
if (times) {
for (const [filePath, date] of times) {
const key = instance.filePathKeyMapper(filePath);
const lastTime = lastTimes.get(key) || startTime;

for (const [filePath, date] of times) {
const key = instance.filePathKeyMapper(filePath);
const lastTime = lastTimes.get(key) || startTime;
if (
!date ||
date === 'ignore' ||
(date.timestamp || date.safeTime) <= lastTime
) {
continue;
}

if (
!date ||
date === 'ignore' ||
(date.timestamp || date.safeTime) <= lastTime
) {
continue;
}

lastTimes.set(key, date.timestamp || date.safeTime);
promises.push(updateFile(instance, key, filePath, loader, loaderIndex));
}
lastTimes.set(key, date.timestamp || date.safeTime);
promises.push(updateFile(instance, key, filePath, loader, loaderIndex));
}

// On watch update add all known dts files expect the ones in node_modules
// (skip @types/* and modules with typings)
for (const [key, { fileName }] of instance.files.entries()) {
if (
fileName.match(constants.dtsDtsxOrDtsDtsxMapRegex) !== null &&
fileName.match(constants.nodeModules) === null
) {
promises.push(
updateFile(instance, key, fileName, loader, loaderIndex)
);
}
// On watch update add all known dts files expect the ones in node_modules
// (skip @types/* and modules with typings)
for (const [key, { fileName }] of instance.files.entries()) {
if (
fileName.match(constants.dtsDtsxOrDtsDtsxMapRegex) !== null &&
fileName.match(constants.nodeModules) === null
) {
promises.push(
updateFile(instance, key, fileName, loader, loaderIndex)
);
}
}
}
}

Expand Down