Log to node console or debug during webpack build

2.4k views Asked by At

What is the best practice for debugging during webpack build process? Any console.log in the entry script doesnt output to node console.

1

There are 1 answers

0
Nick Steele On

As of the current version of webpack (September 2019), if you do a build instead of launch a dev server, console.log will output to std out (i.e. the node console).

Just make sure you are doing a full build (i.e. "npm run build") instead of a dev server (i.e. "npm run dev").

The dev server disables console.logs during the compile process in many circumstances, and/or the way the progress bar updates, the console.log strings are overwritten so you never see them.