MCPcopy Index your code
hub / github.com/webpack/webpack-dev-server / setupHooks

Method setupHooks

lib/Server.js:1897–1923  ·  view source on GitHub ↗

* @private * @returns {void}

()

Source from the content-addressed store, hash-verified

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

Callers 1

initializeMethod · 0.95

Calls 3

sendMessageMethod · 0.95
sendStatsMethod · 0.95
getStatsMethod · 0.95

Tested by

no test coverage detected