Skip to content

Instantly share code, notes, and snippets.

@ryanwilsonperkin
Last active April 8, 2022 14:01
Show Gist options
  • Save ryanwilsonperkin/9b14fcc354e6c24df99c9985e1fa5ccd to your computer and use it in GitHub Desktop.
Save ryanwilsonperkin/9b14fcc354e6c24df99c9985e1fa5ccd to your computer and use it in GitHub Desktop.
Minimal reproduction of timestamp bug in webpack-cli watch mode

Minimal reproduction of a bug in webpack-cli causing the timestamp that gets output on file change to be off by 1000x

Steps to reproduce:

  • Use this file set
  • Run npm watch
  • Modify the index.js file to trigger a recompile

The modified datetime that is specified in the resulting log will be tens of thousands of years in the future. Valid as of webpack-cli v4.9.2

console.log("Hello World");
{
"name": "webpack-watch-timestamp-bug",
"version": "1.0.0",
"main": "index.js",
"author": "Ryan Wilson-Perkin <ryanwilsonperkin@gmail.com>",
"license": "MIT",
"scripts": {
"watch": "webpack build --watch"
},
"devDependencies": {
"webpack": "5.72.0",
"webpack-cli": "4.9.2"
}
}
module.exports = {
mode: 'development',
entry: './index.js',
infrastructureLogging: {
level: 'verbose',
},
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment