Merge pull request #15182 from webpack/bugfix/lib-ident-includes-layer
Module.libIdent is scoped by the module layer if there is one
This commit is contained in:
commit
c41eb368f2
|
@ -275,6 +275,7 @@ class ContextModule extends Module {
|
|||
this.context,
|
||||
options.associatedObjectForCache
|
||||
);
|
||||
if (this.layer) identifier = `(${this.layer})/${identifier}`;
|
||||
if (this.options.mode) {
|
||||
identifier += ` ${this.options.mode}`;
|
||||
}
|
||||
|
|
|
@ -355,11 +355,13 @@ class NormalModule extends Module {
|
|||
* @returns {string | null} an identifier for library inclusion
|
||||
*/
|
||||
libIdent(options) {
|
||||
return contextify(
|
||||
let ident = contextify(
|
||||
options.context,
|
||||
this.userRequest,
|
||||
options.associatedObjectForCache
|
||||
);
|
||||
if (this.layer) ident = `(${this.layer})/${ident}`;
|
||||
return ident;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -79,7 +79,9 @@ class ContainerEntryModule extends Module {
|
|||
* @returns {string | null} an identifier for library inclusion
|
||||
*/
|
||||
libIdent(options) {
|
||||
return `webpack/container/entry/${this._name}`;
|
||||
return `${this.layer ? `(${this.layer})/` : ""}webpack/container/entry/${
|
||||
this._name
|
||||
}`;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -60,9 +60,9 @@ class FallbackModule extends Module {
|
|||
* @returns {string | null} an identifier for library inclusion
|
||||
*/
|
||||
libIdent(options) {
|
||||
return `webpack/container/fallback/${this.requests[0]}/and ${
|
||||
this.requests.length - 1
|
||||
} more`;
|
||||
return `${this.layer ? `(${this.layer})/` : ""}webpack/container/fallback/${
|
||||
this.requests[0]
|
||||
}/and ${this.requests.length - 1} more`;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -67,7 +67,9 @@ class RemoteModule extends Module {
|
|||
* @returns {string | null} an identifier for library inclusion
|
||||
*/
|
||||
libIdent(options) {
|
||||
return `webpack/container/remote/${this.request}`;
|
||||
return `${this.layer ? `(${this.layer})/` : ""}webpack/container/remote/${
|
||||
this.request
|
||||
}`;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -101,7 +101,9 @@ class ConsumeSharedModule extends Module {
|
|||
*/
|
||||
libIdent(options) {
|
||||
const { shareKey, shareScope, import: request } = this.options;
|
||||
return `webpack/sharing/consume/${shareScope}/${shareKey}${
|
||||
return `${
|
||||
this.layer ? `(${this.layer})/` : ""
|
||||
}webpack/sharing/consume/${shareScope}/${shareKey}${
|
||||
request ? `/${request}` : ""
|
||||
}`;
|
||||
}
|
||||
|
|
|
@ -67,7 +67,9 @@ class ProvideSharedModule extends Module {
|
|||
* @returns {string | null} an identifier for library inclusion
|
||||
*/
|
||||
libIdent(options) {
|
||||
return `webpack/sharing/provide/${this._shareScope}/${this._name}`;
|
||||
return `${this.layer ? `(${this.layer})/` : ""}webpack/sharing/provide/${
|
||||
this._shareScope
|
||||
}/${this._name}`;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue