
const util = require('util');

function SplitPlugin () {}

module.exports = SplitPlugin;

SplitPlugin.prototype.apply = function (compiler)
{
	compiler.plugin("this-compilation", function (compilation)
	{
		compilation.plugin(["optimize-chunks", "optimize-extracted-chunks"], function (chunks)
		{
/*			console.log ("\n");

			chunks.forEach (function processChunk (chunk, idx)
			{
				chunk.modules.forEach (function (module)
				{
					console.log (module.userRequest);
					console.log ("+"+module.resource);
					console.log ("+"+module.index);
					console.log (util.inspect (module, { showHidden: false, depth: 2 }));
				});
			});

			console.log ("\n");
*/		});
	});
};
