【发布时间】:2021-11-27 22:52:59
【问题描述】:
我在我的nodejs 项目中使用nodemon,因为我希望每当我进行任何更改时它都会自动重新启动一切正常,但现在问题是我想使用一个库
其中包括 puppeteer lib 每当我进行任何更改时 nodemon 关闭铬浏览器并重新打开它需要一些时间。这使我发展缓慢。有什么办法可以阻止这种行为。
这是我的代码。
const express = require("express");
const app = express();
const http = require("http");
const server = http.createServer(app);
const { Client } = require("whatsapp-web.js");
const client = new Client({ puppeteer: { headless: false } });
client.initialize();
console.log("changes 7");
server.listen(3000, () => {
console.log("listening on *:3000");
});
每当我进行任何更改时,它都会重新启动一切。我不想每次都重启client。
【问题讨论】: