UNPKG

webpackbar

Version:

Elegant ProgressBar and Profiler for Webpack and Rspack

39 lines (33 loc) 1.24 kB
'use strict'; const rspack = require('@rspack/core'); const plugin = require('./shared/webpackbar.e03748fc.cjs'); require('std-env'); require('pretty-time'); require('node:path'); require('ansis'); require('consola'); require('node:process'); function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e.default : e; } const rspack__default = /*#__PURE__*/_interopDefaultCompat(rspack); 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__default.ProgressPlugin { constructor(options) { super((percent, message, ...details) => { if (this.webpackbar) { this.webpackbar.updateProgress(percent, message, details); } }); __publicField(this, "webpackbar"); this.webpackbar = new plugin.WebpackBar(options); } apply(compiler) { super.apply(compiler); this.webpackbar.apply(compiler); } } module.exports = WebpackBarProgressPlugin;