Send message for clients to hot reload after deleting or adding a new route.

This commit is contained in:
Dillon Kearns 2021-05-17 18:35:51 -07:00
parent 9585e41d9a
commit 12e5f88e10

View File

@ -116,6 +116,19 @@ async function start(options) {
if (needToRerunCodegen(eventName, pathThatChanged)) {
try {
await codegen.generate();
clientElmMakeProcess = compileElmForBrowser();
pendingCliCompile = compileCliApp();
Promise.all([clientElmMakeProcess, pendingCliCompile])
.then(() => {
elmMakeRunning = false;
})
.catch(() => {
elmMakeRunning = false;
});
clients.forEach((client) => {
client.response.write(`data: elm.js\n\n`);
});
} catch (error) {
codegenError = error;
}