unable to see request logs in webpack-dev-server

后端 未结 1 728
悲&欢浪女
悲&欢浪女 2021-02-07 00:21

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 p

1条回答
  •  北荒
    北荒 (楼主)
    2021-02-07 00:28

    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.

    0 讨论(0)
提交回复
热议问题