ProgressPlugin

このプラグインは、プログレスバーを設定するために使用できます。

Rspackは、プログレスバーを描画するためにindicatif::ProgressBarを使用します。

new rspack.ProgressPlugin(options);

オプション

関数

フックが進行状況を報告するときに呼び出されるハンドラー関数を提供します。handler関数の引数

  • percentage: コンパイルの完了率を示す0から1の間の数値
  • message: 現在実行中のフックの簡単な説明
  • ...args: 現在の進行状況を説明する0個以上の追加の文字列
const handler = (percentage, message, ...args) => {
  // e.g. Output each progress message directly to the console:
  console.info(percentage, message, ...args);
};

new rspack.ProgressPlugin(handler);

オブジェクト

prefix

  • 型: string
  • デフォルト: 'Rspack'

このテキストは、プログレスバーの前に表示されます。

profile

  • 型: boolean
  • デフォルト: false

ProgressPluginに、進行状況ステップのプロファイルデータを収集するように指示します。

template

  • 型: string
  • デフォルト: ● {prefix:.bold} {bar:25.green/white.dim} ({percent}%) {wide_msg:.dim}

プログレスバーのテンプレート。

indicatif::ProgressBar::with_templateも参照してください。

tick

  • 型: string | string[] | undefined
  • デフォルト: undefined

スピナーのティック文字列シーケンス。文字列の場合は、文字に分割されます。

indicatif::ProgressBar::tick_stringsも参照してください。

progressChars

  • 型: string
  • デフォルト: ━━

進行状況の文字(filled, current, to do)

indicatif::ProgressBar::progress_charsも参照してください。