mirror of https://github.com/webpack/webpack.git
Compute identifier in context module in constructor
This commit is contained in:
parent
8c11da5219
commit
ee22d498fe
|
|
@ -45,7 +45,7 @@ class ContextModule extends Module {
|
|||
if (typeof options.mode !== "string")
|
||||
throw new Error("options.mode is a required option");
|
||||
|
||||
this._identifier = null;
|
||||
this._identifier = this._createIdentifier();
|
||||
}
|
||||
|
||||
prettyRegExp(regexString) {
|
||||
|
|
@ -66,8 +66,7 @@ class ContextModule extends Module {
|
|||
.join("!");
|
||||
}
|
||||
|
||||
identifier() {
|
||||
if (this._identifier) return this._identifier;
|
||||
_createIdentifier() {
|
||||
let identifier = this.context;
|
||||
if (this.options.resourceQuery)
|
||||
identifier += ` ${this.options.resourceQuery}`;
|
||||
|
|
@ -86,6 +85,10 @@ class ContextModule extends Module {
|
|||
return identifier;
|
||||
}
|
||||
|
||||
identifier() {
|
||||
return this._identifier;
|
||||
}
|
||||
|
||||
readableIdentifier(requestShortener) {
|
||||
let identifier = requestShortener.shorten(this.context);
|
||||
if (this.options.resourceQuery)
|
||||
|
|
|
|||
Loading…
Reference in New Issue