| 
									
										
										
										
											2014-03-31 17:33:17 +08:00
										 |  |  | /* | 
					
						
							|  |  |  | 	MIT License http://www.opensource.org/licenses/mit-license.php
 | 
					
						
							|  |  |  | 	Author Tobias Koppers @sokra | 
					
						
							|  |  |  | */ | 
					
						
							|  |  |  | var CaseSensitiveModulesWarning = require("./CaseSensitiveModulesWarning"); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | function WarnCaseSensitiveModulesPlugin() { | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | module.exports = WarnCaseSensitiveModulesPlugin; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | WarnCaseSensitiveModulesPlugin.prototype.apply = function(compiler) { | 
					
						
							|  |  |  | 	compiler.plugin("compilation", function(compilation) { | 
					
						
							|  |  |  | 		compilation.plugin("seal", function() { | 
					
						
							|  |  |  | 			var moduleWithoutCase = {}; | 
					
						
							|  |  |  | 			this.modules.forEach(function(module) { | 
					
						
							|  |  |  | 				var ident = module.identifier().toLowerCase(); | 
					
						
							| 
									
										
										
										
											2015-04-24 05:55:50 +08:00
										 |  |  | 				if(moduleWithoutCase["$" + ident]) { | 
					
						
							|  |  |  | 					if(moduleWithoutCase["$" + ident] !== true) | 
					
						
							|  |  |  | 						this.warnings.push(new CaseSensitiveModulesWarning(moduleWithoutCase["$" + ident])); | 
					
						
							| 
									
										
										
										
											2014-03-31 17:33:17 +08:00
										 |  |  | 					this.warnings.push(new CaseSensitiveModulesWarning(module)); | 
					
						
							| 
									
										
										
										
											2015-04-24 05:55:50 +08:00
										 |  |  | 					moduleWithoutCase["$" + ident] = true; | 
					
						
							| 
									
										
										
										
											2014-03-31 17:33:17 +08:00
										 |  |  | 				} else { | 
					
						
							| 
									
										
										
										
											2015-04-24 05:55:50 +08:00
										 |  |  | 					moduleWithoutCase["$" + ident] = module; | 
					
						
							| 
									
										
										
										
											2014-03-31 17:33:17 +08:00
										 |  |  | 				} | 
					
						
							|  |  |  | 			}, this); | 
					
						
							|  |  |  | 		}); | 
					
						
							|  |  |  | 	}); | 
					
						
							|  |  |  | }; |