MCPcopy
hub / github.com/webpack/webpack / constructor

Method constructor

lib/css/CssGenerator.js:149–176  ·  view source on GitHub ↗

* Creates an instance of CssGenerator. * @param {CssModuleGeneratorOptions} options options * @param {ModuleGraph} moduleGraph the module graph

(options, moduleGraph)

Source from the content-addressed store, hash-verified

147 * @param {ModuleGraph} moduleGraph the module graph
148 */
149 constructor(options, moduleGraph) {
150 super();
151 /** @type {CssModuleGeneratorOptions} */
152 this.options = options;
153 /** @type {boolean | undefined} */
154 this._exportsOnly = options.exportsOnly;
155 /** @type {boolean | undefined} */
156 this._esModule = options.esModule;
157 /** @type {ModuleGraph} */
158 this._moduleGraph = moduleGraph;
159 /** @type {WeakMap<Source, ModuleFactoryCacheEntry>} */
160 this._moduleFactoryCache = new WeakMap();
161 const localIdentName = options.localIdentName;
162 // Detect hash placeholders via the canonical template parser so this stays
163 // in sync with `interpolate`'s grammar.
164 const isFn = typeof localIdentName === "function";
165 const kinds =
166 typeof localIdentName === "string"
167 ? getPresentKinds(localIdentName)
168 : undefined;
169 /** @type {boolean} */
170 this._localIdentNeedsHash =
171 isFn ||
172 (kinds !== undefined && (kinds.has("fullhash") || kinds.has("hash")));
173 /** @type {boolean} */
174 this._localIdentNeedsContentHash =
175 isFn || (kinds !== undefined && kinds.has("contenthash"));
176 }
177
178 /**
179 * Returns the reason this module cannot be concatenated, when one exists.

Callers

nothing calls this directly

Calls 2

getPresentKindsFunction · 0.85
hasMethod · 0.45

Tested by

no test coverage detected