mirror of https://github.com/webpack/webpack.git
Cast dependency.constructor to correct type
This commit is contained in:
parent
41343d1763
commit
a39c846c78
|
|
@ -915,11 +915,8 @@ class Compilation extends Tapable {
|
|||
) {
|
||||
throw new Error("Parameter 'dependency' must be a Dependency");
|
||||
}
|
||||
// @ts-ignore
|
||||
// TODO: Not sure how to handle the
|
||||
// dependency.constructor error,
|
||||
// maybe I typed it wrong
|
||||
const moduleFactory = this.dependencyFactories.get(dependency.constructor);
|
||||
const Dep = /** @type {DepConstructor} */ (dependency.constructor);
|
||||
const moduleFactory = this.dependencyFactories.get(Dep);
|
||||
if (!moduleFactory) {
|
||||
throw new Error(
|
||||
`No dependency factory available for this dependency type: ${
|
||||
|
|
|
|||
Loading…
Reference in New Issue