tapio / live-server

A simple development http server with live reload capability.
http://tapiov.net/live-server/
4.41k stars 484 forks source link

Watch directories are ignored #367

Open antonioaltamura opened 3 years ago

antonioaltamura commented 3 years ago

It seems using live-server through node watch directories are simply ignored. I mean if I define watch in my js configuration file, the directories are not recognised and the hot/live reload simple won't work at all.

const liveServer = require("live-server");

const params = {
    port: 3000,
    host: "localhost",
    open: "/src",
    watch: "src,lib/jsorolla/src,lib/jsorolla/styles",
    logLevel: 2
};
liveServer.start(params);
makavelithadon commented 2 years ago

It seems like it works with an array of filepaths (cause chokidar can handle both cf. https://github.com/paulmillr/chokidar)

But in the source code, it expects an array for the watch option. See https://github.com/tapio/live-server/blob/master/index.js#L120

But I agree that the docs does not reflect this.

Hope this helps.