From d390d32fe0f2491c5cc3a8dfae3ccc3962a5911b Mon Sep 17 00:00:00 2001 From: Ryan Wilson-Perkin Date: Mon, 11 Apr 2022 01:54:32 -0400 Subject: [PATCH] fix: changeTime is already in milliseconds (#3198) 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. --- packages/webpack-cli/src/plugins/CLIPlugin.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/webpack-cli/src/plugins/CLIPlugin.ts b/packages/webpack-cli/src/plugins/CLIPlugin.ts index 215049c655e..ae925a49733 100644 --- a/packages/webpack-cli/src/plugins/CLIPlugin.ts +++ b/packages/webpack-cli/src/plugins/CLIPlugin.ts @@ -93,7 +93,7 @@ export class CLIPlugin { }); compiler.hooks.invalid.tap(pluginName, (filename, changeTime) => { - const date = new Date(changeTime * 1000); + const date = new Date(changeTime); this.logger.log(`File '${filename}' was modified`); this.logger.log(`Changed time is ${date} (timestamp is ${changeTime})`);