/*
	MIT License http://www.opensource.org/licenses/mit-license.php
	Author Tobias Koppers @sokra
*/
var DllEntryPlugin = require("./DllEntryPlugin");
var LibManifestPlugin = require("./LibManifestPlugin");
var FlagInitialModulesAsUsedPlugin = require("./FlagInitialModulesAsUsedPlugin");

function DllPlugin(options) {
	this.options = options;
}
module.exports = DllPlugin;
DllPlugin.prototype.apply = function(compiler) {
	compiler.plugin("entry-option", function(context, entry) {
		function itemToPlugin(item, name) {
			if(Array.isArray(item))
				return new DllEntryPlugin(context, item, name);
			else
				throw new Error("DllPlugin: supply an Array as entry");
		}
		if(typeof entry === "object" && !Array.isArray(entry)) {
			Object.keys(entry).forEach(function(name) {
				compiler.apply(itemToPlugin(entry[name], name));
			});
		} else {
			compiler.apply(itemToPlugin(entry, "main"));
		}
		return true;
	});
	compiler.apply(new LibManifestPlugin(this.options));
	compiler.apply(new FlagInitialModulesAsUsedPlugin());
};

@@ -94,14 +94,32 @@
 kra%0A
+%09
 */%0A
-var
+%22use strict%22;%0A%0Aconst
  Dll
@@ -161,19 +161,21 @@
 ugin%22);%0A
-var
+const
  LibMani
@@ -223,11 +223,13 @@
 %22);%0A
-var
+const
  Fla
@@ -304,24 +304,21 @@
 gin%22);%0A%0A
-function
+class
  DllPlug
@@ -319,16 +319,31 @@
 llPlugin
+ %7B%0A%09constructor
 (options
@@ -346,16 +346,17 @@
 ions) %7B%0A
+%09
 %09this.op
@@ -376,74 +376,18 @@
 ns;%0A
+%09
 %7D%0A
-module.exports = DllPlugin;%0ADllPlugin.prototype.apply = function
+%0A%09apply
 (com
@@ -395,16 +395,17 @@
 iler) %7B%0A
+%09
 %09compile
@@ -429,24 +429,16 @@
 ption%22, 
-function
 (context
@@ -445,21 +445,25 @@
 , entry)
+ =%3E
  %7B%0A%09%09
+%09
 function
@@ -493,16 +493,17 @@
 e) %7B%0A%09%09%09
+%09
 if(Array
@@ -518,16 +518,17 @@
 (item))%0A
+%09
 %09%09%09%09retu
@@ -578,13 +578,15 @@
 %0A%09%09%09
+%09
 else%0A
+%09
 %09%09%09%09
@@ -641,22 +641,24 @@
 ntry%22);%0A
+%09
 %09%09%7D%0A%09%09
+%09
 if(typeo
@@ -709,16 +709,17 @@
 )) %7B%0A%09%09%09
+%09
 Object.k
@@ -741,25 +741,19 @@
 ach(
-function(
 name
-)
+ =%3E
  %7B%0A
+%09
 %09%09%09%09
@@ -804,20 +804,22 @@
 e));%0A%09%09%09
+%09
 %7D);%0A
+%09
 %09%09%7D else
@@ -821,16 +821,17 @@
  else %7B%0A
+%09
 %09%09%09compi
@@ -872,18 +872,20 @@
 n%22));%0A%09%09
+%09
 %7D%0A
+%09
 %09%09return
@@ -891,21 +891,23 @@
 n true;%0A
+%09
 %09%7D);%0A
+%09
 %09compile
@@ -952,16 +952,17 @@
 ions));%0A
+%09
 %09compile
@@ -1008,11 +1008,42 @@
 gin());%0A
-%7D
+%09%7D%0A%7D%0A%0Amodule.exports = DllPlugin
 ;%0A

upgrade DllPlugin to ES6 (#3760)