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.compilerPath = compiler.compilerPath;
|
||||
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");
|
||||
|
||||
|
|
|
|||
|
|
@ -212,6 +212,11 @@ class Compiler {
|
|||
this.requestShortener = new RequestShortener(context, this.root);
|
||||
|
||||
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 = "";
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue