live-server icon indicating copy to clipboard operation
live-server copied to clipboard

Watch directories are ignored

Open antonioaltamura opened this issue 4 years ago • 1 comments

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-server version: 1.2.1

antonioaltamura avatar Feb 02 '21 10:02 antonioaltamura

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.

makavelithadon avatar Jan 26 '22 13:01 makavelithadon