MCPcopy
hub / github.com/webpack/webpack / apply

Method apply

lib/NoEmitOnErrorsPlugin.js:18–27  ·  lib/NoEmitOnErrorsPlugin.js::NoEmitOnErrorsPlugin.apply

* Applies the plugin by registering its hooks on the compiler. * @param {Compiler} compiler the compiler instance * @returns {void}

(compiler)

Source from the content-addressed store, hash-verified

16 * @returns {void}
17 */
18 apply(compiler) {
19 compiler.hooks.shouldEmit.tap(PLUGIN_NAME, (compilation) => {
20 if (compilation.getStats().hasErrors()) return false;
21 });
22 compiler.hooks.compilation.tap(PLUGIN_NAME, (compilation) => {
23 compilation.hooks.shouldRecord.tap(PLUGIN_NAME, () => {
24 if (compilation.getStats().hasErrors()) return false;
25 });
26 });
27 }
28}
29
30module.exports = NoEmitOnErrorsPlugin;

Callers

nothing calls this directly

Calls 3

tapMethod · 0.80
getStatsMethod · 0.80
hasErrorsMethod · 0.45

Tested by

no test coverage detected