mirror of https://github.com/webpack/webpack.git
				
				
				
			Merge pull request #10343 from webpack/compat/cache-readonly
make compiler/compilation.cache read-only
This commit is contained in:
		
						commit
						98cf565c5c
					
				|  | @ -505,6 +505,11 @@ class Compilation { | ||||||
| 		this.requestShortener = compiler.requestShortener; | 		this.requestShortener = compiler.requestShortener; | ||||||
| 		this.compilerPath = compiler.compilerPath; | 		this.compilerPath = compiler.compilerPath; | ||||||
| 		this.cache = compiler.cache; | 		this.cache = compiler.cache; | ||||||
|  | 		// Make this.cache readonly, to make it easier to find incompatible plugins
 | ||||||
|  | 		Object.defineProperty(this, "cache", { | ||||||
|  | 			writable: false, | ||||||
|  | 			value: this.cache | ||||||
|  | 		}); | ||||||
| 
 | 
 | ||||||
| 		this.logger = this.getLogger("webpack.Compilation"); | 		this.logger = this.getLogger("webpack.Compilation"); | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -212,6 +212,11 @@ class Compiler { | ||||||
| 		this.requestShortener = new RequestShortener(context, this.root); | 		this.requestShortener = new RequestShortener(context, this.root); | ||||||
| 
 | 
 | ||||||
| 		this.cache = new Cache(); | 		this.cache = new Cache(); | ||||||
|  | 		// Make this.cache readonly, to make it easier to find incompatible plugins
 | ||||||
|  | 		Object.defineProperty(this, "cache", { | ||||||
|  | 			writable: false, | ||||||
|  | 			value: this.cache | ||||||
|  | 		}); | ||||||
| 
 | 
 | ||||||
| 		this.compilerPath = ""; | 		this.compilerPath = ""; | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue