unjs / webpackbar

Elegant ProgressBar and Profiler for Webpack 3 , 4 and 5
MIT License
2.07k stars 66 forks source link

Cannot read property 'tap' of undefined. #99

Closed Hongbusi closed 3 weeks ago

Hongbusi commented 2 years ago

Cannot read property 'tap' of undefined.

Environment

"webpack": "^5.68.0",
"webpackbar": "^5.0.2"

Problem

const webpack = require('webpack');
const WebpackBar = require('webpackbar');

const compiler = webpack([{}, {}]);

new WebpackBar().apply(compiler);

compiler.hooks[hookName].tap("WebpackBar:" + hookName, fn);

Reason

Multi compiler not supported.

pi0 commented 3 weeks ago

in repo playground we test webpack5 with multi compiler. feel free to reopen if you could reproduce it against latest version.