Webpack console.log output?

前端 未结 1 1648
礼貌的吻别
礼貌的吻别 2021-02-13 20:44

Can anyone direct me in the right direction?

So i\'ve setup the webpack-dev-server with the truffle suite demo, just to get a basis on the foundation of my app. So my c

相关标签:
1条回答
  • 2021-02-13 21:21

    I had this same problem. As far as I can tell, the problem is that Webpack does not actually run the generated code on the server. The process that runs on the server simply checks for file changes and re-compiles when necessary. The code is actually all running on the client. So, the only way to view output from console.log() is to view the client browser's console.

    Part of the confusion here is that while normally, node runs javascript on the server, in this case, node is delegating to a separate program entirely. You can run this whole thing without node installed at all, just using a standalone installation of the webpack executable. Node's execution environment is never used, thus you can't log to it.

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