Skip to content

Commit

Permalink
Fixed compatibility with latest Webpack
Browse files Browse the repository at this point in the history
As of webpack/webpack@5acfacf `.Class`
webpack is using `Dependency::constructor` over `Dependency::Class`. I
decided to keep the `.Class` for backwards compatibility.

Fixes #16
  • Loading branch information
Remon Oldenbeuving committed Nov 9, 2015
1 parent ce9f940 commit 09fb779
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/RewiredDependency.js
Expand Up @@ -12,6 +12,7 @@ function RewiredDependency(request, range) {

RewiredDependency.prototype = Object.create(Dependency.prototype);
RewiredDependency.prototype.type = "rewire";
RewiredDependency.prototype.constructor = RewiredDependency;
RewiredDependency.prototype.isEqualResource = function (other) {
return other instanceof RewiredDependency?
this.request === other.request:
Expand All @@ -20,4 +21,4 @@ RewiredDependency.prototype.isEqualResource = function (other) {

RewiredDependency.Template = require("webpack/lib/dependencies/ModuleDependencyTemplateAsId.js");

module.exports = RewiredDependency;
module.exports = RewiredDependency;

0 comments on commit 09fb779

Please sign in to comment.