* @private * @returns {void}
()
| 1895 | * @returns {void} |
| 1896 | */ |
| 1897 | setupHooks() { |
| 1898 | const compiler = /** @type {Compiler | MultiCompiler} */ (this.compiler); |
| 1899 | |
| 1900 | compiler.hooks.invalid.tap(pluginName, () => { |
| 1901 | if (this.webSocketServer) { |
| 1902 | this.sendMessage(this.webSocketServer.clients, "invalid"); |
| 1903 | } |
| 1904 | }); |
| 1905 | |
| 1906 | compiler.hooks.done.tap( |
| 1907 | pluginName, |
| 1908 | /** |
| 1909 | * @param {Stats | MultiStats} stats stats |
| 1910 | */ |
| 1911 | (stats) => { |
| 1912 | if (this.webSocketServer) { |
| 1913 | this.sendStats(this.webSocketServer.clients, this.getStats(stats)); |
| 1914 | } |
| 1915 | |
| 1916 | /** |
| 1917 | * @private |
| 1918 | * @type {Stats | MultiStats} |
| 1919 | */ |
| 1920 | this.stats = stats; |
| 1921 | }, |
| 1922 | ); |
| 1923 | } |
| 1924 | |
| 1925 | /** |
| 1926 | * @private |
no test coverage detected