Override the require function

后端 未结 4 1155
故里飘歌
故里飘歌 2020-12-08 10:45

Is it possible to override the global require function, affecting it at process level?

From what I know, the require

4条回答
  •  攒了一身酷
    2020-12-08 10:54

    mock-require does this by overriding Module._load (which is what the real require actually calls).

提交回复
热议问题