webpackbar
Elegant ProgressBar and Profiler for Webpack
Last updated 3 months ago by pi0 .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install webpackbar 
SYNC missed versions from official npm registry.

Standard JS npm version npm downloads package phobia

Elegant ProgressBar and Profiler for Webpack

✔ Display elegant progress bar while building or watch

✔ Support of multiple concurrent builds (useful for SSR)

✔ Pretty print filename and loaders

✔ Windows compatible

Fully customizable using reporters

✔ Advanced build profiler


Multi progress bars



Build Profiler


Getting Started

To begin, you'll need to install webpackbar:

Using npm:

npm install webpackbar -D

Using yarn:

yarn add webpackbar -D

Then add the reporter as a plugin to your webpack config.

webpack.config.js

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

module.exports = {
  context: path.resolve(__dirname),
  devtool: 'source-map',
  entry: './entry.js',
  output: {
    filename: './output.js',
    path: path.resolve(__dirname)
  },
  plugins: [
    new WebpackBar()
  ]
};

Options

name

  • Default: webpack

Name.

color

  • Default: green

Primary color (can be HEX like #xxyyzz or a web color like green).

profile

  • Default: false

Enable profiler.

fancy

  • Default: true when not in CI or testing mode.

Enable bars reporter.

basic

  • Default: true when running in minimal environments.

Enable a simple log reporter (only start and end).

reporter

Register a custom reporter.

reporters

  • Default: []

Register an Array of your custom reporters. (Same as reporter but array)

Custom Reporters

Webpackbar comes with a fancy progress-bar out of the box. But you may want to show progress somewhere else or provide your own.

For this purpose, you can provide one or more extra reporters using reporter and reporters options.

NOTE: If you plan to provide your own reporter, don't forget to setting fancy and basic options to false to prevent conflicts.

A reporter should be instance of a class or plain object and functions for special hooks. It is not necessary to implement all functions, webpackbar only calls those that exists.

Simple logger:

{
 start(context) {
   // Called when (re)compile is started
 },
 change(context) {
   // Called when a file changed on watch mode
 },
 update(context) {
   // Called after each progress update
 },
 done(context) {
   // Called when compile finished
 },
 progress(context) {
   // Called when build progress updated
 },
 allDone(context) {
   // Called when _all_ compiles finished
 },
 beforeAllDone(context) {
 },
 afterAllDone(context) {
 },
}

context is the reference to the plugin. You can use context.state to access status.

Schema of context.state:

{
  start,
  progress,
  message,
  details,
  request,
  hasErrors
}

License

MIT - Made with ???? By Nuxt.js team!

Current Tags

  • 2.6.4                                ...           2x (7 months ago)
  • 3.2.0                                ...           latest (3 months ago)

47 Versions

  • 3.2.0                                ...           3 months ago
  • 3.1.5                                ...           6 months ago
  • 3.1.4                                ...           7 months ago
  • 2.6.4                                ...           7 months ago
  • 3.1.3                                ...           8 months ago
  • 3.1.2                                ...           8 months ago
  • 3.1.1                                ...           8 months ago
  • 3.1.0                                ...           8 months ago
  • 3.0.5                                ...           8 months ago
  • 3.0.4                                ...           8 months ago
  • 3.0.3                                ...           8 months ago
  • 3.0.2                                ...           8 months ago
  • 3.0.1                                ...           8 months ago
  • 3.0.0                                ...           8 months ago
  • 3.0.0-3                                ...           8 months ago
  • 3.0.0-2                                ...           8 months ago
  • 3.0.0-1                                ...           9 months ago
  • 3.0.0-0                                ...           9 months ago
  • 2.6.3                                ...           a year ago
  • 2.6.2                                ...           a year ago
  • 2.6.1                                ...           a year ago
  • 2.6.0                                ...           a year ago
  • 2.5.0                                ...           a year ago
  • 2.4.0                                ...           a year ago
  • 2.3.2                                ...           a year ago
  • 2.3.1                                ...           a year ago
  • 2.3.0                                ...           a year ago
  • 2.2.1                                ...           a year ago
  • 2.2.0                                ...           a year ago
  • 2.1.0                                ...           a year ago
  • 2.0.3                                ...           a year ago
  • 2.0.2                                ...           a year ago
  • 2.0.1                                ...           a year ago
  • 2.0.0                                ...           a year ago
  • 1.5.1                                ...           a year ago
  • 1.5.0                                ...           a year ago
  • 1.4.0                                ...           a year ago
  • 1.3.0                                ...           a year ago
  • 1.2.1                                ...           a year ago
  • 1.2.0                                ...           a year ago
  • 1.1.4                                ...           a year ago
  • 1.1.3                                ...           a year ago
  • 1.1.2                                ...           a year ago
  • 1.1.1                                ...           a year ago
  • 1.1.0                                ...           a year ago
  • 1.0.0                                ...           a year ago
  • 0.0.0                                ...           a year ago
Downloads
Today 59
This Week 9,305
This Month 36,049
Last Day 2,334
Last Week 13,666
Last Month 49,613
Dependencies (8)
Dependents (279)

Copyright 2014 - 2016 © taobao.org |