Last change
on this file since fa375fe was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago |
initial commit
|
-
Property mode
set to
100644
|
File size:
713 bytes
|
Rev | Line | |
---|
[6a3a178] | 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 |
|
---|
| 10 | class NoEmitOnErrorsPlugin {
|
---|
| 11 | /**
|
---|
| 12 | * Apply the plugin
|
---|
| 13 | * @param {Compiler} compiler the compiler instance
|
---|
| 14 | * @returns {void}
|
---|
| 15 | */
|
---|
| 16 | apply(compiler) {
|
---|
| 17 | compiler.hooks.shouldEmit.tap("NoEmitOnErrorsPlugin", compilation => {
|
---|
| 18 | if (compilation.getStats().hasErrors()) return false;
|
---|
| 19 | });
|
---|
| 20 | compiler.hooks.compilation.tap("NoEmitOnErrorsPlugin", compilation => {
|
---|
| 21 | compilation.hooks.shouldRecord.tap("NoEmitOnErrorsPlugin", () => {
|
---|
| 22 | if (compilation.getStats().hasErrors()) return false;
|
---|
| 23 | });
|
---|
| 24 | });
|
---|
| 25 | }
|
---|
| 26 | }
|
---|
| 27 |
|
---|
| 28 | module.exports = NoEmitOnErrorsPlugin;
|
---|
Note:
See
TracBrowser
for help on using the repository browser.