fix: dont add styles twice initially
happens with the serveAllStyles option
The styles will be already be added later by the watcher.
This seems to be intoruced with the switch to chokidar
in ea89d11021
Instead we could also add the option ignoreInitial to chokidar
Signed-off-by: David Weber | geOps <david.weber@geops.com>
This commit is contained in:
parent
26d8066cdc
commit
fe435ae5c4
1 changed files with 0 additions and 15 deletions
|
@ -295,21 +295,6 @@ function start(opts) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (options.serveAllStyles) {
|
if (options.serveAllStyles) {
|
||||||
fs.readdir(options.paths.styles, { withFileTypes: true }, (err, files) => {
|
|
||||||
if (err) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
for (const file of files) {
|
|
||||||
if (file.isFile() && path.extname(file.name).toLowerCase() == '.json') {
|
|
||||||
const id = path.basename(file.name, '.json');
|
|
||||||
const item = {
|
|
||||||
style: file.name,
|
|
||||||
};
|
|
||||||
addStyle(id, item, false, false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
const watcher = chokidar.watch(
|
const watcher = chokidar.watch(
|
||||||
path.join(options.paths.styles, '*.json'),
|
path.join(options.paths.styles, '*.json'),
|
||||||
{},
|
{},
|
||||||
|
|
Loading…
Reference in a new issue