| | |
| | | const util = require("util"); |
| | | const Watchpack = require("watchpack"); |
| | | |
| | | /** @typedef {import("watchpack").TimeInfoEntries} TimeInfoEntries */ |
| | | /** @typedef {import("watchpack").WatchOptions} WatchOptions */ |
| | | /** @typedef {import("../util/fs").InputFileSystem} InputFileSystem */ |
| | | /** @typedef {import("../util/fs").WatchMethod} WatchMethod */ |
| | | /** @typedef {import("../util/fs").Changes} Changes */ |
| | |
| | | |
| | | class NodeWatchFileSystem { |
| | | /** |
| | | * Creates an instance of NodeWatchFileSystem. |
| | | * @param {InputFileSystem} inputFileSystem input filesystem |
| | | */ |
| | | constructor(inputFileSystem) { |
| | | /** @type {InputFileSystem} */ |
| | | this.inputFileSystem = inputFileSystem; |
| | | /** @type {WatchOptions} */ |
| | | this.watcherOptions = { |
| | | aggregateTimeout: 0 |
| | | }; |
| | |
| | | } |
| | | |
| | | const fetchTimeInfo = () => { |
| | | /** @type {TimeInfoEntries} */ |
| | | const fileTimeInfoEntries = new Map(); |
| | | /** @type {TimeInfoEntries} */ |
| | | const contextTimeInfoEntries = new Map(); |
| | | if (this.watcher) { |
| | | this.watcher.collectTimeInfoEntries( |
| | |
| | | this.watcher.once( |
| | | "aggregated", |
| | | /** |
| | | * Handles the callback logic for this hook. |
| | | * @param {Changes} changes changes |
| | | * @param {Removals} removals removals |
| | | */ |