Giter VIP home page Giter VIP logo

webpackbar's Introduction

npm version npm downloads package phobia github actions

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

webpackbar's People

Contributors

ambar avatar audiolion avatar clarkdo avatar clementprevot avatar danielroe avatar eleith avatar godky avatar hulkish avatar isnifer avatar jordanmaslyn avatar josh-cena avatar liueng avatar mannil avatar negezor avatar nozomuikuta avatar phorsuedzie avatar pi0 avatar rchl avatar redahas avatar renovate[bot] avatar timneutkens avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

webpackbar's Issues

Bars aren't filling completely before rendering success

image

  • Operating System: OSX
  • Node Version: 8.11.3
  • NPM Version: 5.6
  • webpack Version: 4ish
  • webpack-serve Version: Unknown

This issue is for a:

  • bug
  • feature request
  • modification request

Code

webpack.config.js

https://github.com/lucleray/next-progressbar

Expected Behavior

Bar to be filled completely

Actual Behavior

Bars are partially filled before reporting success

How Do We Reproduce?

https://github.com/lucleray/next-progressbar

This question is available on Nuxt community (#c16)

Support webpack 5

What problem does this feature solve?

I used webpackbar with webpack 5 for a while and found no compatibility issue, since npm 7 requires peer dependencies to match strictly, it is better to publish a new version upgrading peerDependencies to enable webpack 5

This feature request is available on Nuxt community (#c47)

Show see the full error when building my App using webpack with the webpackbar plugin?

What problem does this feature solve?

Can't see the full error message when building My App. It would be a problem if error when building, I can't troubleshoot errors quickly maybe running webpack compiler in CI or Docker.

What does the proposed changes look like?

Now It is pretty good and useful for me, But I really hope it can show the full error when an error occurs in the future, It will be better.

This feature request is available on Nuxt community (#c46)

Don't run in CI

When the progress bar runs in my CI (jenkins) it produces an insane amount of output. Maybe you could use the package 'isCi' to disable the progress bar in the CI environment

This question is available on Nuxt.js community (#c4)

feature request

I have an ideal for the profile part, currently, the incremental build time is accumulative. How about we add option to display time cost for each build?

I can submit a PR if you like.

This question is available on Nuxt community (#c17)

Add stats for minification time and plugins

This issue is for a:

  • bug
  • feature request
  • modification request

New Feature Use Case

Currently the only output shown is this:

Stats by Ext

╔════════╤══════════╤═══════╤══════════════╤══════════════════╗
║ Ext    │ Requests │ Time  │ Time/Request │ Description      ║
╟────────┼──────────┼───────┼──────────────┼──────────────────╢
║ js     │ 1112     │ 12s   │ 11ms         │ JavaScript files ║
╟────────┼──────────┼───────┼──────────────┼──────────────────╢
║ jsx    │ 369      │ 2s    │ 5ms          │ jsx files        ║
╟────────┼──────────┼───────┼──────────────┼──────────────────╢
║ hbs    │ 295      │ 3s    │ 11ms         │ hbs files        ║
╟────────┼──────────┼───────┼──────────────┼──────────────────╢
║ less   │ 45       │ 641ms │ 14ms         │ less files       ║
╟────────┼──────────┼───────┼──────────────┼──────────────────╢
║ less 0 │ 19       │ 853μs │ 45μs         │ less 0 files     ║
╟────────┼──────────┼───────┼──────────────┼──────────────────╢
║ css 0  │ 13       │ 561μs │ 43μs         │ css 0 files      ║
╟────────┼──────────┼───────┼──────────────┼──────────────────╢
║ svg    │ 1        │ 3ms   │ 3ms          │ svg files        ║
╟────────┼──────────┼───────┼──────────────┼──────────────────╢
║ css    │ 3        │ 53ms  │ 18ms         │ css files        ║
╟────────┼──────────┼───────┼──────────────┼──────────────────╢
║ Total  │ 1857     │ 18s   │              │                  ║
╚════════╧══════════╧═══════╧══════════════╧══════════════════╝


Stats by Loader

╔═══════════════════╤══════════╤═══════╤══════════════╤═══════════════════╗
║ Loader            │ Requests │ Time  │ Time/Request │ Description       ║
╟───────────────────┼──────────┼───────┼──────────────┼───────────────────╢
║ babel-loader      │ 1450     │ 14s   │ 9ms          │ Babel Loader      ║
╟───────────────────┼──────────┼───────┼──────────────┼───────────────────╢
║ handlebars-loader │ 295      │ 3s    │ 11ms         │ Handlebars Loader ║
╟───────────────────┼──────────┼───────┼──────────────┼───────────────────╢
║ expose-loader     │ 1        │ 5ms   │ 5ms          │ Expose Loader     ║
╟───────────────────┼──────────┼───────┼──────────────┼───────────────────╢
║ css-loader        │ 80       │ 696ms │ 9ms          │ Css Loader        ║
╟───────────────────┼──────────┼───────┼──────────────┼───────────────────╢
║ postcss-loader    │ 68       │ 695ms │ 10ms         │ Postcss Loader    ║
╟───────────────────┼──────────┼───────┼──────────────┼───────────────────╢
║ less-loader       │ 64       │ 642ms │ 10ms         │ Less Loader       ║
╟───────────────────┼──────────┼───────┼──────────────┼───────────────────╢
║ exports-loader    │ 29       │ 316ms │ 11ms         │ Exports Loader    ║
╟───────────────────┼──────────┼───────┼──────────────┼───────────────────╢
║ imports-loader    │ 19       │ 256ms │ 13ms         │ Imports Loader    ║
╟───────────────────┼──────────┼───────┼──────────────┼───────────────────╢
║ raw-loader        │ 1        │ 3ms   │ 3ms          │ Raw Loader        ║
╟───────────────────┼──────────┼───────┼──────────────┼───────────────────╢
║ Total             │ 2007     │ 19s   │              │                   ║
╚═══════════════════╧══════════╧═══════╧══════════════╧═══════════════════╝

However, a lot of the webpack build time is also spent in minification and plugins, would it be possible to add that info?

This question is available on Nuxt community (#c20)

Double progress

  • Operating System: osx 10.13.4
  • Node Version: 10.0.0
  • NPM Version: 5.6.0
  • webpack Version: 4.6.0
  • webpack-serve Version:

This issue is for a:

  • bug
  • feature request
  • modification request

Expected Behavior

Single progress

Actual Behavior

Double progress bars

  • webpack dev server
    image
  • webpack
    image

How Do We Reproduce?

Start app with webpack dev server and with this plugin

Log failure when used with Karma

ERROR [karma]: TypeError: this.__write is not a function
    at WriteStream.write (node_modules/webpackbar/dist/utils/log-update.js:89:16)
    at adapters.forEach (node_modules/karma/lib/reporters/base.js:73:16)
    at Array.forEach (<anonymous>)
    at MochaReporter.BaseReporter.write (node_modules/karma/lib/reporters/base.js:68:19)
    at MochaReporter.BaseReporter.writeCommonMsg (node_modules/karma/lib/reporters/base.js:79:16)
    at MochaReporter.BaseReporter.onBrowserLog (node_modules/karma/lib/reporters/base.js:100:12)
    at Server.<anonymous> (node_modules/karma/lib/events.js:40:26)
    at Server.emit (events.js:187:15)
    at Browser.onInfo (node_modules/karma/lib/browser.js:100:20)
    at Socket.socket.on (node_modules/karma/lib/browser.js:272:38)

It seems that your reporter is clashing with Karma's reporter when overriding process.stdout.write. Am I doing something wrong or is this a known issue?

Type doesn't match built output

In the built dist we have

module.exports = WebpackBarPlugin;

in webpackbar.js, which means it should be imported as

import * as WebpackBar from 'webpackbar';

However, in generated type, it is declared as

export default WebpackBarPlugin;

which assumes it is imported as

import Webpackbar from 'webpackbar'

Type 'WebpackBar' is not assignable to type '((this: Compiler, compiler: Compiler) => void)

Type 'WebpackBar' is not assignable to type '((this: Compiler, compiler: Compiler) => void) | WebpackPluginInstance'.
  Type 'WebpackBar' is not assignable to type 'WebpackPluginInstance'.
    Types of property 'apply' are incompatible.
      Type '(compiler: import("c:/FRONTEND/www/group-dashboard/group-dashboard-postman/node_modules/@types/webpackbar/node_modules/@types/webpack/index").Compiler) => void' is not assignable to type '(compiler: import("c:/FRONTEND/www/group-dashboard/group-dashboard-postman/node_modules/webpack/types").Compiler) => void'.
        Types of parameters 'compiler' and 'compiler' are incompatible.
          Property '_pluginCompat' is missing in type 'import("c:/FRONTEND/www/group-dashboard/group-dashboard-postman/node_modules/webpack/types").Compiler' but required in type 'import("c:/FRONTEND/www/group-dashboard/group-dashboard-postman/node_modules/@types/webpackbar/node_modules/@types/webpack/index").Compiler'.

erase the prev lines length

problem description

  1. when the process.stderr.columns less than console.log('xxxxxx') string width, extra lines log, wrap line normal;
  2. the prevLineCount variable length calculate error;
  3. cause the terminal stdout occurs many whitespace lines;

source code

// LogUpdate -> render
const data = ansiEscapes.eraseLines(this.prevLineCount) + wrappedLines + '\n' + this.extraLines;
this.write(data);
// it's my problem === length is not true
this.prevLineCount = data.split('\n').length;

could you calculate length below?

this.prevLineCount = data.split('\n').length;
this.extraLines.split('\n').forEach(str => {
  if (str.length > this.columns) {
    this.prevLineCount += 1
  }
});

That's all, thank you!

Error `path.replace is not a function`

Please consider casting path in this line to string:

https://github.com/nuxt/webpackbar/blob/73ef3ae64f92a049500d5494f87b684024926d8f/src/utils/index.js#L42

Because in my experience path can be number.


I don't have any good reproduction (sorry), so my proposal is to just add cast to string. Just to be complete, here is full stack trace with this error:

PATH/node_modules/@nuxt/webpack/node_modules/webpackbar/dist/utils/index.js:58
  return path.replace(cwd, '');
              ^

TypeError: path.replace is not a function
    at shortenPath (PATH/node_modules/@nuxt/webpack/node_modules/webpackbar/dist/utils/index.js:58:15)
    at PATH/node_modules/@nuxt/webpack/node_modules/webpackbar/dist/plugin.js:182:43
    at SyncHook.eval [as call] (eval at create (PATH/node_modules/@nuxt/webpack/node_modules/webpack/node_modules/tapable/lib/HookCodeFactory.js:19:10), <anonymous>:7:1)
    at SyncHook.lazyCompileHook (PATH/node_modules/@nuxt/webpack/node_modules/webpack/node_modules/tapable/lib/Hook.js:154:20)
    at Watchpack.watcher.compiler.watchFileSystem.watch (PATH/node_modules/@nuxt/webpack/node_modules/webpack/lib/Watching.js:139:33)
    at Object.onceWrapper (events.js:285:13)
    at Watchpack.emit (events.js:197:13)
    at Watchpack.EventEmitter.emit (domain.js:446:20)
    at Watchpack._onChange (PATH/node_modules/watchpack/lib/watchpack.js:118:7)
    at Watchpack.<anonymous> (PATH/node_modules/watchpack/lib/watchpack.js:109:8)
    at Watcher.emit (events.js:197:13)
    at Watcher.EventEmitter.emit (domain.js:446:20)
    at PATH/node_modules/watchpack/lib/DirectoryWatcher.js:101:9
    at Array.forEach (<anonymous>)
    at DirectoryWatcher.setFileTime (PATH/node_modules/watchpack/lib/DirectoryWatcher.js:99:42)
    at DirectoryWatcher.onFileAdded (PATH/node_modules/watchpack/lib/DirectoryWatcher.js:250:7)
    at FSWatcher.emit (events.js:197:13)
    at FSWatcher.EventEmitter.emit (domain.js:446:20)
    at FSWatcher.<anonymous> (PATH/node_modules/watchpack/node_modules/chokidar/index.js:199:15)
    at FSWatcher._emit (PATH/node_modules/watchpack/node_modules/chokidar/index.js:241:5)
    at FSWatcher.<anonymous> (PATH/node_modules/watchpack/node_modules/chokidar/lib/nodefs-handler.js:465:12)
    at FSReqCallback.oncomplete (fs.js:159:5)

This question is available on Nuxt community (#c34)

When serving nuxt in a development enviroment, the webpack UI gets messed up.

  • Operating System: Windows 10 1803
  • Node Version: v10.8.0
  • NPM Version: 6.2.0
  • webpack Version: Whatever comes with nuxt@2
  • webpack-serve Version: Whatever comes with nuxt@2

This issue is for a:

  • bug
  • feature request
  • modification request

Code

CLI Command
  $ nuxt

Expected Behavior

When using the command next it compiles, clears the console on most cases and then it shows you the ip and port where your app is being served on.

Actual Behavior

Lots of text gets left behind, progressbars don't even complete and it fails to show ip and port as shown on the following picture:

How Do We Reproduce?

Just by running the command nuxt.

This question is available on Nuxt community (#c19)

The Console Gets Cleared

I'm trying to integrate it in create-guten-block.

I ejected and removed all the clear console functions so that nothing gets cleared.

Then I added webpackbar to it.

Configured it like you said and comment the stats comment so that we get all the stats.

But it still goes away after compiling.

Check 👇

image

Help! ⚠️

This question is available on Nuxt.js community (#c3)

Webpack Error after adding plugin

I'm unable to run webpack after adding the plugin, stack trace is as below:

Node version: v9.3.0
Webpack version: 3.10.0
Package version: 1.1.3

/usr/local/lib/node_modules/webpack/bin/webpack.js:348
			throw err;
			^

TypeError: Cannot read property 'done' of undefined
    at WebpackBarPlugin.apply (/Users/arjun/Projects/dashboard/node_modules/webpackbar/dist/index.js:61:20)
    at Compiler.apply (/usr/local/lib/node_modules/webpack/node_modules/tapable/lib/Tapable.js:375:16)
    at webpack (/usr/local/lib/node_modules/webpack/lib/webpack.js:33:19)
    at processOptions (/usr/local/lib/node_modules/webpack/bin/webpack.js:335:15)
    at yargs.parse (/usr/local/lib/node_modules/webpack/bin/webpack.js:396:2)
    at Object.Yargs.self.parse (/usr/local/lib/node_modules/webpack/node_modules/yargs/yargs.js:533:18)
    at Object.<anonymous> (/usr/local/lib/node_modules/webpack/bin/webpack.js:152:7)
    at Module._compile (module.js:660:30)
    at Object.Module._extensions..js (module.js:671:10)
    at Module.load (module.js:573:32)
    at tryModuleLoad (module.js:513:12)
    at Function.Module._load (module.js:505:3)
    at Function.Module.runMain (module.js:701:10)
    at startup (bootstrap_node.js:194:16)
    at bootstrap_node.js:618:3
This question is available on Nuxt.js community (#c1)

stats.json messed up with outputs from webpackbar

First of all, thanks so much for this wonderful progress bar.

I was using webpackbar and tried to write a stats.json file to be used by webpack-bundle-analyzer.

Here's my npm script:

webpack --env=production --profile --json > stats.json

However, stats.json contains some output from webpackbar. Here's how it looks like:

ℹ Compiling Webpack                                        webpackbar 18:06:57
✔ Webpack: Compiled successfully in 3.22s                  webpackbar 18:07:00
{
  "errors": [],
  "warnings": [],
  "version": "4.29.3",
  "hash": "ed64caf72379ba267639",
  "time": 3228,
  "builtAt": 1549976820840,
  "publicPath": "/",
  "outputPath": "/Users/shahzaib/my-stuff/serious-projects/testing-shaizei/copy-jetsetter/build",
  "assetsByChunkName": {
    "main": [
    // remaining file is not included for brevity
}

Due to these two lines (in the start), stats.json is becoming invalid.

Any workaround for this?

This question is available on Nuxt community (#c33)

Duplicate bars on webpack error

Version

v3.0.0

Reproduction link

https://github.com/manniL/lichter.io

Steps to reproduce

webpackbar-duplicated-bars

  1. Download latest master version (linked above)
  2. Install deps
  3. Run yarn generate

Happens in WebStorm terminal but also in normal Gnome Terminal. (Running Ubuntu LTS)

What is expected ?

No duplicate Client bar

What is actually happening?

Duplicate bar

This bug report is available on Nuxt community (#c26)

Duplicated profiling information in the console

  • Operating System: Windows 7
  • Node Version: 8.9.4
  • NPM Version: 5.6.0
  • webpack Version: 4.16
  • webpack-serve Version: 2.0.2

This issue is for a:

  • bug
  • feature request
  • modification request

Code

webpack.config.js
  plugins: [
                new WebpackBar({
                    profile: true,
                    minimal: false,
                    compiledIn: false,
                    done
                }),
                new HardSourceWebpackPlugin(),
                new HtmlWebpackPlugin({
                    ...htmlDefault,
                    env: 'development',
                    filename: 'index.html',
                }),
]

Expected Behavior

I expect to see the profile information only once in the console.

Actual Behavior

The profiling information is outputted before Webpack is done.
So, it first appears in the middle of compiling and then again once Webpack is done.

The done callback is also called twice - but both times (looking at the stats object) webpack says it's done....

How Do We Reproduce?

This is what the output looks like:

i 「serve」: Serving Static Content from: src\lib\config\parts
i 「hot」: WebSocket Server Listening on 172.25.14.140:55368
i 「serve」: Project is running at http://172.25.14.140:5600
i 「serve」: Server URI copied to clipboard
[hardsource:133d4ee0] Using 43 MB of disk space.
[hardsource:133d4ee0] Writing new cache 133d4ee0...
[hardsource:133d4ee0] Tracking node dependencies with: package-lock.json.

Stats by Ext

╔════════╤══════════╤═══════╤══════════════╤══════════════════╗
║ Ext │ Requests │ Time │ Time/Request │ Description ║
╟────────┼──────────┼───────┼──────────────┼──────────────────╢
║ js │ 1 │ 33ms │ 33ms │ JavaScript files ║
╟────────┼──────────┼───────┼──────────────┼──────────────────╢
║ scss │ 10 │ 752ms │ 75ms │ SASS files ║
╟────────┼──────────┼───────┼──────────────┼──────────────────╢
║ scss 0 │ 1 │ 69μs │ 69μs │ scss 0 files ║
╟────────┼──────────┼───────┼──────────────┼──────────────────╢
║ Total │ 12 │ 785ms │ │ ║
╚════════╧══════════╧═══════╧══════════════╧══════════════════╝

Stats by Loader

╔════════════════════╤══════════╤═══════╤══════════════╤════════════════════╗
║ Loader │ Requests │ Time │ Time/Request │ Description ║
╟────────────────────┼──────────┼───────┼──────────────┼────────────────────╢
║ babel-loader │ 1 │ 33ms │ 33ms │ Babel Loader ║
╟────────────────────┼──────────┼───────┼──────────────┼────────────────────╢
║ css-loader │ 11 │ 752ms │ 68ms │ Css Loader ║
╟────────────────────┼──────────┼───────┼──────────────┼────────────────────╢
║ postcss-loader │ 11 │ 752ms │ 68ms │ Postcss Loader ║
╟────────────────────┼──────────┼───────┼──────────────┼────────────────────╢
║ resolve-url-loader │ 11 │ 752ms │ 68ms │ Resolve Url Loader ║
╟────────────────────┼──────────┼───────┼──────────────┼────────────────────╢
║ sass-loader │ 11 │ 752ms │ 68ms │ Sass Loader ║
╟────────────────────┼──────────┼───────┼──────────────┼────────────────────╢
║ Total │ 45 │ 3s │ │ ║
╚════════════════════╧══════════╧═══════╧══════════════╧════════════════════╝

 Access project at:     

http://172.25.14.140:5600

✔︎ Webpack compiled in: 1335ms
[hardsource:66f4e04f] Using 43 MB of disk space.
[hardsource:66f4e04f] Writing new cache 66f4e04f...
[hardsource:66f4e04f] Tracking node dependencies with: package-lock.json.
i 「hot」: Applying DefinePlugin:hotClientOptions
i 「hot」: webpack: Compiling...

Stats by Ext

╔════════╤══════════╤═══════╤══════════════╤══════════════════╗
║ Ext │ Requests │ Time │ Time/Request │ Description ║
╟────────┼──────────┼───────┼──────────────┼──────────────────╢
║ js │ 2 │ 34ms │ 17ms │ JavaScript files ║
╟────────┼──────────┼───────┼──────────────┼──────────────────╢
║ scss │ 19 │ 878ms │ 46ms │ SASS files ║
╟────────┼──────────┼───────┼──────────────┼──────────────────╢
║ scss 0 │ 2 │ 113μs │ 56μs │ scss 0 files ║
╟────────┼──────────┼───────┼──────────────┼──────────────────╢
║ Total │ 23 │ 912ms │ │ ║
╚════════╧══════════╧═══════╧══════════════╧══════════════════╝

Stats by Loader

╔════════════════════╤══════════╤═══════╤══════════════╤════════════════════╗
║ Loader │ Requests │ Time │ Time/Request │ Description ║
╟────────────────────┼──────────┼───────┼──────────────┼────────────────────╢
║ babel-loader │ 2 │ 34ms │ 17ms │ Babel Loader ║
╟────────────────────┼──────────┼───────┼──────────────┼────────────────────╢
║ css-loader │ 21 │ 878ms │ 42ms │ Css Loader ║
╟────────────────────┼──────────┼───────┼──────────────┼────────────────────╢
║ postcss-loader │ 21 │ 878ms │ 42ms │ Postcss Loader ║
╟────────────────────┼──────────┼───────┼──────────────┼────────────────────╢
║ resolve-url-loader │ 21 │ 878ms │ 42ms │ Resolve Url Loader ║
╟────────────────────┼──────────┼───────┼──────────────┼────────────────────╢
║ sass-loader │ 21 │ 878ms │ 42ms │ Sass Loader ║
╟────────────────────┼──────────┼───────┼──────────────┼────────────────────╢
║ Total │ 86 │ 4s │ │ ║
╚════════════════════╧══════════╧═══════╧══════════════╧════════════════════╝

 Access project at:     

http://172.25.14.140:5600

i 「hot」: webpack: Compiling Done

This question is available on Nuxt community (#c13)

Error "Cannot convert undefined or null to object" after upgrade from 2.6.3 to 3.0.x

Version

v3.0.3

Reproduction link

https://github.com/nuxt/webpackbar

Steps to reproduce

Build a project with create-react-app, webpack 3 and react-app-rewired, with following config-override :

module.exports = {
	webpack: function (config, env) {

		config.plugins = (config.plugins || []).concat([
			new WebpackBar({
				profile: true,
			})
		])

		return config

	}
}

Or way to reproduce the issue : run tests for ant-design project (https://github.com/ant-design/ant-design) with npm run dist.
See CI failure here : https://circleci.com/gh/ant-design/ant-design/24699?utm_campaign=vcs-integration-link&utm_medium=referral&utm_source=github-build-link.
The upgrade has been reverted since by this commit : ant-design/ant-design@5204b45

What is expected ?

No error

What is actually happening?

Error Cannot convert undefined or null to object

This bug report is available on Nuxt community (#c23)

Have same formatting output as Listr (or make it an option)

What problem does this feature solve?

This is a really minor nit, but this formatting drives me crazy
Screen Shot 2018-11-07 at 4.49.52 PM.png

As far as I'm aware, I'm not sure if your new custom reporters will solve this problem. All I want is for the checkmarks to line up and not to have that new line above. I'm combining your module with https://github.com/SamVerschueren/listr in tandem, hence the concern. This has literally zero effect on the actual use of this repo. I just want to align the outputs 😭.

What does the proposed changes look like?

Remove the new line​ above the completed step
Align the checkmark with a single space indentation

This feature request is available on Nuxt community (#c21)

Show additional information on bar

What problem does this feature solve?

Currently, webpackbar don't show all the information about the build. For example

This wepbackBar:

● Server █████████████████████████ basic chunk optimization (76%)

This ProfilePlugin at the same time:

77% advanced chunk optimization LimitChunkCountPlugin

In this case, I spend more time in the search were a problem in build. Because additional information was skipped

What does the proposed changes look like?

Show additional information about plugins

● Server █████████████████████████ basic chunk optimization (76%)
 LimitChunkCountPlugin
This feature request is available on Nuxt community (#c37)

Add option to hide compilation duration

What problem does this feature solve?

As Webpackbar, some other Webpack plugins also show compilation time.
Obviously this information is not needed twice, so it could be nice to be able hide hide it.

Thanks

This feature request is available on Nuxt community (#c32)

RangeError: Maximum call stack size exceeded

I use:

  1. nuxtjs 2.15.8
  2. node 16.13.1
  3. npm 8.2.0

After command npm run dev (cross-env NODE_ENV=development PORT=3333 sails lift):

C:\Users\KEY_2_PK\Desktop\repos\ASUBPnew5\node_modules@nuxt\webpack\node_modules\webpackbar\dist\webpackbar.js:168
const str = String(data);
^

RangeError: Maximum call stack size exceeded
at String ()
at LogUpdate._onData (C:\Users\KEY_2_PK\Desktop\repos\ASUBPnew5\node_modules@nuxt\webpack\node_modules\webpackbar\dist\webpackbar.js:168:17)
at WriteStream.write (C:\Users\KEY_2_PK\Desktop\repos\ASUBPnew5\node_modules@nuxt\webpack\node_modules\webpackbar\dist\webpackbar.js:196:14)
at WriteStream.write (C:\Users\KEY_2_PK\Desktop\repos\ASUBPnew5\node_modules@nuxt\webpack\node_modules\webpackbar\dist\webpackbar.js:193:25)
at WriteStream.write (C:\Users\KEY_2_PK\Desktop\repos\ASUBPnew5\node_modules@nuxt\webpack\node_modules\webpackbar\dist\webpackbar.js:198:44)
at WriteStream.write (C:\Users\KEY_2_PK\Desktop\repos\ASUBPnew5\node_modules@nuxt\webpack\node_modules\webpackbar\dist\webpackbar.js:193:25)
at WriteStream.write (C:\Users\KEY_2_PK\Desktop\repos\ASUBPnew5\node_modules@nuxt\webpack\node_modules\webpackbar\dist\webpackbar.js:198:44)
at WriteStream.write (C:\Users\KEY_2_PK\Desktop\repos\ASUBPnew5\node_modules@nuxt\webpack\node_modules\webpackbar\dist\webpackbar.js:193:25)
at WriteStream.write (C:\Users\KEY_2_PK\Desktop\repos\ASUBPnew5\node_modules@nuxt\webpack\node_modules\webpackbar\dist\webpackbar.js:198:44)
at WriteStream.write (C:\Users\KEY_2_PK\Desktop\repos\ASUBPnew5\node_modules@nuxt\webpack\node_modules\webpackbar\dist\webpackbar.js:193:25)
at WriteStream.write (C:\Users\KEY_2_PK\Desktop\repos\ASUBPnew5\node_modules@nuxt\webpack\node_modules\webpackbar\dist\webpackbar.js:198:44)
at WriteStream.write (C:\Users\KEY_2_PK\Desktop\repos\ASUBPnew5\node_modules@nuxt\webpack\node_modules\webpackbar\dist\webpackbar.js:193:25)
at WriteStream.write (C:\Users\KEY_2_PK\Desktop\repos\ASUBPnew5\node_modules@nuxt\webpack\node_modules\webpackbar\dist\webpackbar.js:198:44)
at WriteStream.write (C:\Users\KEY_2_PK\Desktop\repos\ASUBPnew5\node_modules@nuxt\webpack\node_modules\webpackbar\dist\webpackbar.js:193:25)
at WriteStream.write (C:\Users\KEY_2_PK\Desktop\repos\ASUBPnew5\node_modules@nuxt\webpack\node_modules\webpackbar\dist\webpackbar.js:198:44)
at WriteStream.write (C:\Users\KEY_2_PK\Desktop\repos\ASUBPnew5\node_modules@nuxt\webpack\node_modules\webpackbar\dist\webpackbar.js:193:25)
at WriteStream.write (C:\Users\KEY_2_PK\Desktop\repos\ASUBPnew5\node_modules@nuxt\webpack\node_modules\webpackbar\dist\webpackbar.js:198:44)
at WriteStream.write (C:\Users\KEY_2_PK\Desktop\repos\ASUBPnew5\node_modules@nuxt\webpack\node_modules\webpackbar\dist\webpackbar.js:193:25)
at WriteStream.write (C:\Users\KEY_2_PK\Desktop\repos\ASUBPnew5\node_modules@nuxt\webpack\node_modules\webpackbar\dist\webpackbar.js:198:44)
at WriteStream.write (C:\Users\KEY_2_PK\Desktop\repos\ASUBPnew5\node_modules@nuxt\webpack\node_modules\webpackbar\dist\webpackbar.js:193:25)
at WriteStream.write (C:\Users\KEY_2_PK\Desktop\repos\ASUBPnew5\node_modules@nuxt\webpack\node_modules\webpackbar\dist\webpackbar.js:198:44)
at WriteStream.write (C:\Users\KEY_2_PK\Desktop\repos\ASUBPnew5\node_modules@nuxt\webpack\node_modules\webpackbar\dist\webpackbar.js:193:25)
at WriteStream.write (C:\Users\KEY_2_PK\Desktop\repos\ASUBPnew5\node_modules@nuxt\webpack\node_modules\webpackbar\dist\webpackbar.js:198:44)
at WriteStream.write (C:\Users\KEY_2_PK\Desktop\repos\ASUBPnew5\node_modules@nuxt\webpack\node_modules\webpackbar\dist\webpackbar.js:193:25)
at WriteStream.write (C:\Users\KEY_2_PK\Desktop\repos\ASUBPnew5\node_modules@nuxt\webpack\node_modules\webpackbar\dist\webpackbar.js:198:44)
at WriteStream.write (C:\Users\KEY_2_PK\Desktop\repos\ASUBPnew5\node_modules@nuxt\webpack\node_modules\webpackbar\dist\webpackbar.js:193:25)
at WriteStream.write (C:\Users\KEY_2_PK\Desktop\repos\ASUBPnew5\node_modules@nuxt\webpack\node_modules\webpackbar\dist\webpackbar.js:198:44)
at WriteStream.write (C:\Users\KEY_2_PK\Desktop\repos\ASUBPnew5\node_modules@nuxt\webpack\node_modules\webpackbar\dist\webpackbar.js:193:25)

How do I fix this error?

Questions

Congratulation for this very nice and useful plugin.
I wanted to know if it's possible to configure the plugin in some way to have the following:

  1. show the dev server host only when the first build is completed.
    e.g. "The application is running at http://localhost:8080"
    I don't want to show on subsequent builds.

  2. Is it possible to only see the colored progress bar without the information about the build ?

thanks

This question is available on Nuxt community (#c18)

When we run the webpackback with the report in fancy, the previous instructions in the terminal are lost

Version

v3.0.0

Steps to reproduce

Run with the reporter option in fancy

What is expected ?

The output should be

$ yarn build
yarn run v1.17.3
$ yarn build:release
$ lerna run build:release --stream
lerna notice cli v3.16.4
lerna info Executing command in 1 package: "yarn run build:release"
application: $ yarn build:release:application && yarn build:release:renderer
application: $ webpack --color --mode production --config webpack.main.config.js
✔ Webpack
application:   Compiled successfully in 1.47s
application: $ webpack --color --mode production --config webpack.renderer.config.js
✔ Webpack
application:   Compiled successfully in 1.91s
lerna success run Ran npm script 'build:release' in 1 package in 6.1s:
lerna success - application
✨  Done in 6.98s.

What is actually happening?

The current output is

application: ✔ Webpack
application:   Compiled successfully in 1.93s
lerna success run Ran npm script 'build:release' in 1 package in 6.1s:
lerna success - application
✨  Done in 6.93s.

Additional comments?

Basically the method _renderStates in the FancyReporter class is adding unnecessaries jump lines ("\n")

  _renderStates(statesArray) {
    lastRender = Date.now();
    const renderedStates = statesArray.map(c => this._renderState(c)).join('\n\n');
    logUpdate.render("\n" + renderedStates + "\n");
  }

The fix for this issue is just to remove the unnecessaries jump lines like this:

  _renderStates(statesArray) {
    lastRender = Date.now();
    const renderedStates = statesArray.map(c => this._renderState(c)).join('\n');
    logUpdate.render(renderedStates);
  }
This bug report is available on Nuxt community (#c39)

create react app not work fine

config

const path = require(`path`);
const WebpackBar = require("webpackbar");
const CracoLessPlugin = require("craco-less");
module.exports = {
  plugins: [
    {
      plugin: CracoLessPlugin,
      options: {
        lessLoaderOptions: {
          lessOptions: {
            modifyVars: { "@primary-color": "#1DA57A" },
            javascriptEnabled: true,
          },
        },
      },
    },
  ],
  webpack: {
    alias: {
      "@": path.resolve(__dirname, "src/"),
    },
    // @ts-ignore
    plugins: [new WebpackBar({ name: "admin" })],
  },
};

problem
QQ20210208-190048@2x

DeprecationWarning: Tapable.plugin is deprecated

Version

3.1.3

Reproduction link

https://github.com/nuxt/webpackbar

Steps to reproduce

update webpack to 4.
(Seems webpack 4 updated the plugin interface.)

What is expected ?

No warning log

What is actually happening?

(node:89719) DeprecationWarning: Tapable.plugin is deprecated. Use new API on `.hooks` instead
    at WebpackBarPlugin.apply (/projects/antd/rc-antd/node_modules/[email protected]@webpack/lib/ProgressPlugin.js:59:13)
    at WebpackBarPlugin.apply (/projects/antd/rc-antd/node_modules/[email protected]@webpackbar/dist/plugin.js:158:11)
    at webpack (/projects/antd/rc-antd/node_modules/[email protected]@webpack/lib/webpack.js:47:13)
    at options.map.options (/projects/antd/rc-antd/node_modules/[email protected]@webpack/lib/webpack.js:35:55)
    at Array.map (<anonymous>)
    at webpack (/projects/antd/rc-antd/node_modules/[email protected]@webpack/lib/webpack.js:35:40)
    at dist (/projects/antd/rc-antd/node_modules/[email protected]@antd-tools/lib/gulpfile.js:40:3)
    at Gulp.gulp.task.done (/projects/antd/rc-antd/node_modules/[email protected]@antd-tools/lib/gulpfile.js:102:3)
    at module.exports (/projects/antd/rc-antd/node_modules/[email protected]@orchestrator/lib/runTask.js:34:7)
    at Gulp.Orchestrator._runTask (/projects/antd/rc-antd/node_modules/[email protected]@orchestrator/index.js:273:3)
    at Gulp.Orchestrator._runStep (/projects/antd/rc-antd/node_modules/[email protected]@orchestrator/index.js:214:10)
    at Gulp.Orchestrator.start (/projects/antd/rc-antd/node_modules/[email protected]@orchestrator/index.js:134:8)
    at Object.<anonymous> (/projects/antd/rc-antd/node_modules/[email protected]@antd-tools/lib/cli/run.js:25:8)
    at Module._compile (module.js:652:30)
    at Object.Module._extensions..js (module.js:663:10)
    at Module.load (module.js:565:32)
This question is available on Nuxt community (#c30)

Webpackbar's info will disappear when use webpack5

Version

[email protected]
[email protected]

Steps to reproduce

use webpack5 run two webpack builds concurrently like below

const webpack = require('webpack')
const serverConfig = require('./webpack.server')
const clientConfig = require('./webpack.client')


const serverCompiler = webpack(serverConfig)
const clientCompiler = webpack(clientConfig)


webpackCompiler(serverCompiler)
webpackCompiler(clientCompiler)

function webpackCompiler(compiler) {
    compiler.run((err, stats) => {
        if (stats.hasErrors()) {
            const error = new Error('wepack build error')
            error.stack = stats.toString('errors-only')

            throw error
        }
    })
}

What is actually happening?

We see two bars, but server bar's info will disappear after server compiler done.

image

What is expected ?

The two bar's info show correctly.
image

Confusing output when running two builds concurrently

Version

v4.0.0

Reproduction link

https://github.com/OliverJAsh/webpack-concurrently/tree/bar

Steps to reproduce

Reduced test case: https://github.com/OliverJAsh/webpack-concurrently/tree/bar

Note: you must use the bar branch.

Run yarn and then npm run compile.

We are running two webpack builds concurrently. Each webpack build has its own instance of the WebpackBar plugin, with a unique name (client and server).

What is actually happening?

  • We see two bars, but a single bar will flicker between client and server.
  • One of the bars never updates.

Screen Recording 2020-06-03 at 13 35 04

What is expected ?

I would not expect this flickering—each build should have its own bar and it should not interfere with other bar instances.

This bug report is available on Nuxt community (#c44)

ESLint is broken as soon as WebpackBar is added as a plugin

  • Operating System: Ubuntu
  • Node Version: 9.9.0
  • NPM Version: 5.6.0
  • webpack Version: 4.6.0
  • eslint Version: 4.19.1
  • webpack-serve Version: -

This issue is for a:

  • bug
  • feature request
  • modification request

Code

CLI Command
yarn run lint
webpack.config.js

https://github.com/nobt-io/frontend/blob/f71c5079d3b35a1389ce5d7425c090b1963a9823/webpack.config.js

.eslintrc.js

https://github.com/nobt-io/frontend/blob/f71c5079d3b35a1389ce5d7425c090b1963a9823/.eslintrc.js

Expected Behavior

ESLint runs as usual

Actual Behavior

ESLint reports at lot of errors because it fails to resolve imports

How Do We Reproduce?

  • git clone https://github.com/nobt-io/frontend
  • git checkout feature/webpackbar
  • yarn install
  • yarn run lint

Lint fails.

  • git checkout HEAD^1
  • yarn run lint

Lint succeeds.

If you look at the commit, nothing else is changed besides adding the webpackbar plugin.
I think it has something do with the referencing the webpack config in .eslintrc.js. However, I don't understand why adding WebpackBar changes any of that.

This question is available on Nuxt.js community (#c11)

No Stats

update to 3.0.0, There's no Stats by Ext or Stats by Loader.
But 2.5.0 is fine.

This question is available on Nuxt community (#c22)

When we run the webpackback with the report in fancy, the previous instructions in the terminal are lost

This is the current output

application: ✔ Webpack
application:   Compiled successfully in 1.93s
lerna success run Ran npm script 'build:release' in 1 package in 6.1s:
lerna success - application
✨  Done in 6.93s.

and should be

$ yarn build
yarn run v1.17.3
$ yarn build:release
$ lerna run build:release --stream
lerna notice cli v3.16.4
lerna info Executing command in 1 package: "yarn run build:release"
application: $ yarn build:release:application && yarn build:release:renderer
application: $ webpack --color --mode production --config webpack.main.config.js
✔ Webpack
application:   Compiled successfully in 1.47s
application: $ webpack --color --mode production --config webpack.renderer.config.js
✔ Webpack
application:   Compiled successfully in 1.91s
lerna success run Ran npm script 'build:release' in 1 package in 6.1s:
lerna success - application
✨  Done in 6.98s.

Basically the method _renderStates in the FancyReporter class is adding unnecessaries jump lines ("\n")

  _renderStates(statesArray) {
    lastRender = Date.now();
    const renderedStates = statesArray.map(c => this._renderState(c)).join('\n\n');
    logUpdate.render("\n" + renderedStates + "\n");
  }

The fix for this issue is just to remove the unnecessaries jump lines like this:

  _renderStates(statesArray) {
    lastRender = Date.now();
    const renderedStates = statesArray.map(c => this._renderState(c)).join('\n');
    logUpdate.render(renderedStates);
  }
This question is available on Nuxt community (#c40)

Progress Bar Closes Before Compilation Completes

  • Operating System: OSX Sierra
  • Node Version: 8.11.0
  • NPM Version: 5.6.0
  • webpack Version: 3x & 4x
  • webpack-serve Version: 2x & 3x

This issue is for a:

  • bug
  • feature request
  • modification request

Code

const app = new DevServer(compiler, serverOptions);

let hasRun = false;

app.middleware.waitUntilValid(() => {
  if (!hasRun) {
    app.listen(hotPort, host, (err) => {});
  }
});

or

compiler.run(() => {});
webpack.config.js

https://gist.github.com/dtothefp/7769a27293cf771dbd60fe46dcc99c3c

Expected Behavior

When progress bar finishes Webpack compilation finishes and task proceeds

Actual Behavior

Progress bar finishes and task hangs while webpack does some unknown work behind the scenes.

How Do We Reproduce?

This is most likely not an issue with webpackbar but with Webpack itself. I'm putting this issue here to gain clarity on what is happening so I can put an issue up on Webpack with pertinent information.

I'm using app.middleware.waitUntilValid to signal task completion although I've tried using compiler.hooks.done.tap or v3 compiler.plugin('done'. I see this same code in the webpackbar source but it seems the progress bar shows compilation completion well before the callback for done is called. I have a large app and completion of the initial build takes about 1min although subsequent reloads with WebpackDevServer or compiler.watch show completion in the progress bar in about 4s. Unfortunately, after progress bar completes a typical wait time for calling of the done callback is at least 30s. I'd like to understand this issue greater so I can figure out where the bottlenecks are in my Webpack build are as I'm trying to increase performance.

Cannot read property 'tap' of undefined

node: 8.12.0
webpack: 4.21.0

(node:19004) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'tap' of undefined
(node:19004) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)
(node:19004) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
This question is available on Nuxt community (#c25)

When we run the webpackback with the report in fancy, the previous instructions in the terminal are lost

This is the current output

application: ✔ Webpack
application:   Compiled successfully in 1.93s
lerna success run Ran npm script 'build:release' in 1 package in 6.1s:
lerna success - application
✨  Done in 6.93s.

and should be

$ yarn build
yarn run v1.17.3
$ yarn build:release
$ lerna run build:release --stream
lerna notice cli v3.16.4
lerna info Executing command in 1 package: "yarn run build:release"
application: $ yarn build:release:application && yarn build:release:renderer
application: $ webpack --color --mode production --config webpack.main.config.js
✔ Webpack
application:   Compiled successfully in 1.47s
application: $ webpack --color --mode production --config webpack.renderer.config.js
✔ Webpack
application:   Compiled successfully in 1.91s
lerna success run Ran npm script 'build:release' in 1 package in 6.1s:
lerna success - application
✨  Done in 6.98s.

Basically the method _renderStates in the FancyReporter class is adding unnecessaries jump lines ("\n")

  _renderStates(statesArray) {
    lastRender = Date.now();
    const renderedStates = statesArray.map(c => this._renderState(c)).join('\n\n');
    logUpdate.render("\n" + renderedStates + "\n");
  }

The fix for this issue is just to remove the unnecessaries jump lines like this:

  _renderStates(statesArray) {
    lastRender = Date.now();
    const renderedStates = statesArray.map(c => this._renderState(c)).join('\n');
    logUpdate.render(renderedStates);
  }

Can you guys confirm me if this is a bug? or the current output is fine?

This question is available on Nuxt community (#c38)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.