`webpack –watch` should write to stdout at the beginning and end of incremental build

Do you want to request a feature or report a bug?
Feature request.

What is the current behavior?
webpack --watch does not write anything to stdout that would clearly indicate the current incremental build has (1) started or (2) is done/complete. See image attached.

What is the expected behavior?
I would expect, for the purposes of ecosystem tooling, that webpack --watch would write a clear message to stdout (1) when a file changed and (2) when it was done outputting the new result.

For example, tsc --watch writes this to stdout:
(1) “File change detected.”
(2) “Compilation completed.”

In this way, tsc allows ecosystem tooling to “hook into” tsc -w, and listen for stdout so as to hook into tsc -w. You can see the output from tsc -w in the picture below.

If this is a feature request, what is motivation or use case for changing the behavior?
The motivation is write better test runners that can run tests upon changes.

Please mention other relevant information such as the browser version, Node.js version, webpack version and Operating System.

Here is tsc -w output:

screenshot 2017-10-28 13 20 55

Here is webpack -w output:

screenshot 2017-10-28 13 18 06

As you can see, it’s pretty much impossible to know when webpack -w has completed it’s incremental build.

Author: Fantashit

2 thoughts on “`webpack –watch` should write to stdout at the beginning and end of incremental build

  1. Can this be reopened? This is a big issue for getting problem matchers to work in vscode. Especially if the webpack config returns more than 1 config. A simple message when it detected a file change, and another at the end of all the re-compiles.

  2. This is still a problem even with using –info-verbosity verbose, because end message is not generated after all errors are shown to stdout, so it is not useful for using as vscode problem matcher.

    For example, this is generated when error is reported using ts-loader:

    Compilation starting…
    Compilation finished
    Hash: 9f5804b616b6b7ae6618
    Version: webpack 4.17.2
    Time: 1583ms
    Built at: 2018-09-04 15:04:08
                   Asset      Size           Chunks                    Chunk Names
    ./cmanager.js  3.28 MiB  cmanager  [emitted]  [big]  cmanager
     + 3 hidden assets
    Entrypoint cmanager [big] = ./manifest.js ./vendor.js ../css/cmanager.css ./cmanager.js
    [../cty/sys/data/comparer.ts] 574 bytes {cmanager} [built] [10 errors]
    [../cty/sys/index.ts] 1.82 KiB {cmanager} [built]
        + 731 hidden modules
    ERROR in /home/edvinv/repos/cty/sys/data/comparer.ts
    [tsl] ERROR in /home/edvinv/repos/cty/sys/data/comparer.ts(5,21)
          TS1005: '(' expected.

    I would expect that all outputs would be wrapped inside ‘Compilation starting…’ and ‘Compilation finished’, but this is not the case.

Comments are closed.