Skip to content

Commit 4751a2d

Browse files
fix: changeTime is already in milliseconds
We need to pass the timestamp in milliseconds to the date constructor, this code was assuming that changeTime was in seconds and needed to be multiplied by 1000 to get milliseconds but it is already in milliseconds. This led to the constructed date being incorrect.
1 parent 6d778a5 commit 4751a2d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/webpack-cli/src/plugins/CLIPlugin.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ export class CLIPlugin {
9393
});
9494

9595
compiler.hooks.invalid.tap(pluginName, (filename, changeTime) => {
96-
const date = new Date(changeTime * 1000);
96+
const date = new Date(changeTime);
9797

9898
this.logger.log(`File '${filename}' was modified`);
9999
this.logger.log(`Changed time is ${date} (timestamp is ${changeTime})`);

0 commit comments

Comments
 (0)