source: frontend/node_modules/webpack/lib/NoEmitOnErrorsPlugin.js

Last change on this file was 9af201e, checked in by MBK <marija.karapandzova@…>, 11 days ago

Fix frontend appearance

  • Property mode set to 100644
File size: 773 bytes
Line 
1/*
2 MIT License http://www.opensource.org/licenses/mit-license.php
3 Author Tobias Koppers @sokra
4*/
5
6"use strict";
7
8/** @typedef {import("./Compiler")} Compiler */
9
10const PLUGIN_NAME = "NoEmitOnErrorsPlugin";
11
12class NoEmitOnErrorsPlugin {
13 /**
14 * Applies the plugin by registering its hooks on the compiler.
15 * @param {Compiler} compiler the compiler instance
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;
Note: See TracBrowser for help on using the repository browser.