小编eur*_*at7的帖子

如果在监视模式下以最小输出运行,如何将当前时间戳添加到 webpack4 中的输出

当您执行 CI 并使用 webpack 打开一个小窗口来监视您的文件时,有时很难看出 webpack 是否已检测到您的更改(此处为 Windows 10)。

所以我用 --display=minimal 减少了输出。但现在输出只是“33个模块”。看起来都一样。

我想在输出中添加时间戳,以便我可以区分它们。

webpack3 有一个解决方案,它会在 webpack4 中给你一个 DeprecationWarning :

Tapable.plugin is deprecated. Use new API on `.hooks` instead
Run Code Online (Sandbox Code Playgroud)

所以请不要使用这个:

--do not use this in webpack4--  

module.exports = {
  plugins: [
    this.plugin('done',function(){/*...*/})
  ]
}

--do not use this in webpack4--
Run Code Online (Sandbox Code Playgroud)

我错过了一条迁移路径。

continuous-integration webpack webpack-4

3
推荐指数
1
解决办法
1835
查看次数