MCPcopy
hub / github.com/webpack/webpack / cssServerStyleRegistry

Method cssServerStyleRegistry

lib/RuntimeTemplate.js:163–169  ·  view source on GitHub ↗

* Expression for the global registry that collects CSS server-side when there * is no DOM (SSR). An SSR host reads it from `globalThis`; it is keyed by the * style/chunk identifier and namespaced by `output.uniqueName`. * @returns {string} runtime expression evaluating to the registry object

()

Source from the content-addressed store, hash-verified

161 * @returns {string} runtime expression evaluating to the registry object
162 */
163 cssServerStyleRegistry() {
164 const name = this.outputOptions.uniqueName;
165 const key = JSON.stringify(
166 name ? `__webpack_css__${name}` : "__webpack_css__"
167 );
168 return `(${this.assignOr(`globalThis[${key}]`, "{}")})`;
169 }
170
171 supportsConst() {
172 return this.outputOptions.environment.const;

Callers 2

generateMethod · 0.80
generateMethod · 0.80

Calls 1

assignOrMethod · 0.95

Tested by

no test coverage detected