diff --git a/src/adapters/vfs/system.js b/src/adapters/vfs/system.js index f81a2a5..235712f 100644 --- a/src/adapters/vfs/system.js +++ b/src/adapters/vfs/system.js @@ -144,7 +144,11 @@ module.exports = (core) => { } }, mount.attributes.root); - const watch = chokidar.watch(dest, mount.attributes.chokidar || {}); + const chokioptions = Object.assign({ + ignoreInitial: true + }, mount.attributes.chokidar || {}); + + const watch = chokidar.watch(dest, chokioptions); const restr = dest.replace(/\*\*/g, '([^/]*)'); const re = new RegExp(restr + '/(.*)'); const seg = matchSegments(mount.attributes.root) diff --git a/src/config.js b/src/config.js index 43e5fa8..9440b68 100644 --- a/src/config.js +++ b/src/config.js @@ -104,19 +104,21 @@ const defaultConfiguration = { }, vfs: { - watch: false, + watch: true, root: path.join(process.cwd(), 'vfs'), mountpoints: [{ name: 'osjs', attributes: { root: '{root}/dist', - readOnly: true + readOnly: true, + watch: true } }, { name: 'home', attributes: { - root: '{vfs}/{username}' + root: '{vfs}/{username}', + watch: true } }] } diff --git a/src/filesystem.js b/src/filesystem.js index e4645dd..d73625d 100644 --- a/src/filesystem.js +++ b/src/filesystem.js @@ -228,7 +228,7 @@ class Filesystem { */ watch(mountpoint) { if ( - !mountpoint.attributes.watch || + mountpoint.attributes.watch !== true || this.core.config('vfs.watch') === false || !mountpoint.attributes.root ) {