Skip to content

Commit baa450d

Browse files
authored
Merge pull request webpack#7698 from webpack/bugfix/deprecated
replace deprecated method
2 parents f95d0f0 + 8876514 commit baa450d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/Compilation.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ const ChunkTemplate = require("./ChunkTemplate");
2626
const HotUpdateChunkTemplate = require("./HotUpdateChunkTemplate");
2727
const ModuleTemplate = require("./ModuleTemplate");
2828
const RuntimeTemplate = require("./RuntimeTemplate");
29-
const Dependency = require("./Dependency");
3029
const ChunkRenderError = require("./ChunkRenderError");
3130
const AsyncDependencyToInitialChunkError = require("./AsyncDependencyToInitialChunkError");
3231
const Stats = require("./Stats");
@@ -36,6 +35,7 @@ const Queue = require("./util/Queue");
3635
const SortableSet = require("./util/SortableSet");
3736
const GraphHelpers = require("./GraphHelpers");
3837
const ModuleDependency = require("./dependencies/ModuleDependency");
38+
const compareLocations = require("./compareLocations");
3939

4040
/** @typedef {import("./Module")} Module */
4141
/** @typedef {import("./Compiler")} Compiler */
@@ -642,7 +642,7 @@ class Compilation extends Tapable {
642642
war.dependencies = dependencies;
643643
this.warnings.push(war);
644644
}
645-
module.dependencies.sort(Dependency.compare);
645+
module.dependencies.sort((a, b) => compareLocations(a.loc, b.loc));
646646
if (error) {
647647
this.hooks.failedModule.call(module, error);
648648
return callback(error);

0 commit comments

Comments
 (0)