Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

unable to see request logs in webpack-dev-server

I am using webpack-dev-server to act as a CDN server locally to serve various static assets like css, js, html etc.

Everything runs fine but for debugging purposes, I am unable to see the requests received by the CDN server.

webpack-dev-server just goes silent and doesn't show any info/errors once it has compiled the bundle of static assets.

I went through the command line help too but with no success.

like image 523
comiventor Avatar asked Jan 24 '17 07:01

comiventor


1 Answers

Basically, webpack-dev-server uses express to spawn a webserver. To enable seeing logs, one needs to set DEBUG environment variable as required by express

export DEBUG='express:*' 

This started showing me logs of various requests received by webpack-dev-server.

To disable the logs, set the environment variable empty again

export DEBUG= 

This works even for loopback projects and any other NodeJS frameworks which use express as base.

like image 114
comiventor Avatar answered Oct 23 '22 00:10

comiventor