mirror of https://github.com/webpack/webpack.git
				
				
				
			
		
			
				
	
	
		
			13 lines
		
	
	
		
			283 B
		
	
	
	
		
			JavaScript
		
	
	
	
			
		
		
	
	
			13 lines
		
	
	
		
			283 B
		
	
	
	
		
			JavaScript
		
	
	
	
| var a = require("./a");
 | |
| 
 | |
| // get module id
 | |
| var aId = require.resolve("./a.js");
 | |
| 
 | |
| // clear module in require.cache
 | |
| delete require.cache[aId];
 | |
| 
 | |
| // require module again, it should be reexecuted
 | |
| var a2 = require("./a");
 | |
| 
 | |
| // vertify it
 | |
| if(a == a2) throw new Error("Cache clear failed :("); |