Skip to content

Commit e1f0a66

Browse files
committed
add note about webpack 5 refactoring
1 parent 3fb49de commit e1f0a66

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

lib/dependencies/DependencyReference.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77
/** @typedef {import("../Module")} Module */
88

99
class DependencyReference {
10+
// TODO webpack 5: module must be dynamic, you must pass a function returning a module
11+
// This is needed to remove the hack in ConcatenatedModule
12+
// The problem is that the `module` in Dependency could be replaced i. e. because of Scope Hoisting
1013
/**
1114
*
1215
* @param {Module} module the referenced module
@@ -15,6 +18,7 @@ class DependencyReference {
1518
* @param {number} order the order information or NaN if don't care
1619
*/
1720
constructor(module, importedNames, weak = false, order = NaN) {
21+
// TODO webpack 5: make it a getter
1822
this.module = module;
1923
// true: full object
2024
// false: only sideeffects/no export

lib/optimize/ConcatenatedModule.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -429,6 +429,7 @@ class ConcatenatedModule extends Module {
429429
})
430430
.filter(ref => ref);
431431
DependencyReference.sort(references);
432+
// TODO webpack 5: remove this hack, see also DependencyReference
432433
return references.map(ref => {
433434
const dep = map.get(ref);
434435
return () => dep.getReference().module;

0 commit comments

Comments
 (0)