Skip to content

Commit

Permalink
refactor(es6): Upgrade DllModuleFactory to es6
Browse files Browse the repository at this point in the history
  • Loading branch information
TheLarkInn committed Dec 29, 2016
1 parent 79791a5 commit 8613668
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions lib/DllModuleFactory.js
Expand Up @@ -2,18 +2,19 @@
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";

var Tapable = require("tapable");
var DllModule = require("./DllModule");

function DllModuleFactory() {
Tapable.call(this);
class DllModuleFactory extends Tapable {
constructor() {
super();
}
create(data, callback) {
let dependency = data.dependencies[0];
callback(null, new DllModule(data.context, dependency.dependencies, dependency.name, dependency.type));
}
}
module.exports = DllModuleFactory;

DllModuleFactory.prototype = Object.create(Tapable.prototype);
DllModuleFactory.prototype.constructor = DllModuleFactory;

DllModuleFactory.prototype.create = function(data, callback) {
var dependency = data.dependencies[0];
callback(null, new DllModule(data.context, dependency.dependencies, dependency.name, dependency.type));
};
module.exports = DllModuleFactory;

0 comments on commit 8613668

Please sign in to comment.