parent
a6e9f59dfc
commit
c6856e2204
|
@ -1574,10 +1574,11 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
|
|||
if (err) {
|
||||
if (dependencies.every(d => d.optional)) {
|
||||
this.warnings.push(err);
|
||||
return callback();
|
||||
} else {
|
||||
this.errors.push(err);
|
||||
return callback(err);
|
||||
}
|
||||
return callback(err);
|
||||
}
|
||||
|
||||
if (!newModule) {
|
||||
|
|
|
@ -0,0 +1,11 @@
|
|||
it("should not fail for optional modules with bail", () => {
|
||||
let error;
|
||||
try {
|
||||
require("./not-existing");
|
||||
} catch (e) {
|
||||
error = e;
|
||||
}
|
||||
expect(() => {
|
||||
throw error;
|
||||
}).toThrowError();
|
||||
});
|
|
@ -0,0 +1,7 @@
|
|||
module.exports = [
|
||||
[
|
||||
/Module not found/,
|
||||
/Can't resolve '\.\/not-existing' /,
|
||||
{ details: /not-existing\.js/ }
|
||||
]
|
||||
];
|
|
@ -0,0 +1,4 @@
|
|||
/** @type {import("../../../../").Configuration} */
|
||||
module.exports = {
|
||||
bail: true
|
||||
};
|
Loading…
Reference in New Issue