emit code generation errors in deterministic order
This commit is contained in:
parent
80bc311d72
commit
f08c981388
|
@ -51,7 +51,8 @@ const {
|
|||
concatComparators,
|
||||
compareSelect,
|
||||
compareIds,
|
||||
compareStringsNumeric
|
||||
compareStringsNumeric,
|
||||
compareModulesByIdOrIdentifier
|
||||
} = require("./util/comparators");
|
||||
const createHash = require("./util/createHash");
|
||||
const { arrayToSetDeprecation } = require("./util/deprecation");
|
||||
|
@ -1584,6 +1585,7 @@ class Compilation {
|
|||
runtimeTemplate
|
||||
} = this;
|
||||
const results = new Map();
|
||||
const errors = [];
|
||||
for (const module of this.modules) {
|
||||
if (chunkGraph.getNumberOfModuleChunks(module) > 0) {
|
||||
try {
|
||||
|
@ -1595,7 +1597,7 @@ class Compilation {
|
|||
});
|
||||
results.set(module, r);
|
||||
} catch (err) {
|
||||
this.errors.push(new CodeGenerationError(module, err));
|
||||
errors.push(new CodeGenerationError(module, err));
|
||||
results.set(module, {
|
||||
sources: new Map(),
|
||||
runtimeRequirements: null
|
||||
|
@ -1603,6 +1605,17 @@ class Compilation {
|
|||
}
|
||||
}
|
||||
}
|
||||
if (errors.length > 0) {
|
||||
errors.sort(
|
||||
compareSelect(
|
||||
err => err.module,
|
||||
compareModulesByIdOrIdentifier(chunkGraph)
|
||||
)
|
||||
);
|
||||
for (const error of errors) {
|
||||
this.errors.push(error);
|
||||
}
|
||||
}
|
||||
return results;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
module.exports = [
|
||||
[/Circular reexports "\.\/c2.js"\.something --> "\.\/c1.js"\.something -\(circular\)-> "\.\/c2.js"\.something/],
|
||||
[/Circular reexports "\.\/a.js"\.something -\(circular\)-> "\.\/a.js"\.something/],
|
||||
[/Circular reexports "\.\/b.js"\.other --> "\.\/b.js"\.something -\(circular\)-> "\.\/b.js"\.other/],
|
||||
[/Circular reexports "\.\/c2.js"\.something --> "\.\/c1.js"\.something -\(circular\)-> "\.\/c2.js"\.something/],
|
||||
[/Circular reexports "\.\/a.js"\.something -\(circular\)-> "\.\/a.js"\.something/]
|
||||
];
|
||||
|
|
Loading…
Reference in New Issue