webpackbar
Version:
Elegant ProgressBar and Profiler for Webpack and Rspack
33 lines (30 loc) • 1.03 kB
JavaScript
import rspack from '@rspack/core';
import { W as WebpackBar } from './shared/webpackbar.88114b33.mjs';
import 'std-env';
import 'pretty-time';
import 'node:path';
import 'ansis';
import 'consola';
import 'node:process';
var __defProp = Object.defineProperty;
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
var __publicField = (obj, key, value) => {
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
return value;
};
class WebpackBarProgressPlugin extends rspack.ProgressPlugin {
constructor(options) {
super((percent, message, ...details) => {
if (this.webpackbar) {
this.webpackbar.updateProgress(percent, message, details);
}
});
__publicField(this, "webpackbar");
this.webpackbar = new WebpackBar(options);
}
apply(compiler) {
super.apply(compiler);
this.webpackbar.apply(compiler);
}
}
export { WebpackBarProgressPlugin as default };