Skip to content
This repository was archived by the owner on Dec 10, 2019. It is now read-only.

Commit d46ec21

Browse files
committed
Adding refresCSS and reload to liver-server api
1 parent 36e51b1 commit d46ec21

File tree

1 file changed

+21
-1
lines changed

1 file changed

+21
-1
lines changed

index.js

+21-1
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,27 @@ LiveServer.start = function(options) {
382382
.on("error", function (err) {
383383
console.log("ERROR:".red, err);
384384
});
385-
385+
386+
LiveServer.refreshCSS = function () {
387+
if (clients.length) {
388+
clients.forEach(function(ws) {
389+
if (ws) {
390+
ws.send('refreshcss');
391+
}
392+
});
393+
}
394+
};
395+
396+
LiveServer.reload = function () {
397+
if (clients.length) {
398+
clients.forEach(function (ws) {
399+
if (ws) {
400+
ws.send('reload');
401+
}
402+
});
403+
}
404+
};
405+
386406
return server;
387407
};
388408

0 commit comments

Comments
 (0)