live-server
live-server copied to clipboard
Watch directories are ignored
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);
- Command line used for launching
live-server:node live-server.js - OS: Ubuntu 18
- Browser: 88.0.4324.96
- Node.js version: v14.15.1
live-serverversion: 1.2.1
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.