Skip to content

Commit

Permalink
fix: changeTime is already in milliseconds (#3198)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
ryanwilsonperkin authored Apr 11, 2022
1 parent f03c0a6 commit d390d32
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/webpack-cli/src/plugins/CLIPlugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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})`);
Expand Down

0 comments on commit d390d32

Please sign in to comment.