MCPcopy
hub / github.com/webpack/webpack / addModule

Method addModule

lib/Chunk.js:183–192  ·  view source on GitHub ↗

* Adds the provided module to the chunk. * @deprecated * @param {Module} module the module * @returns {boolean} true, if the chunk could be added

(module)

Source from the content-addressed store, hash-verified

181 * @returns {boolean} true, if the chunk could be added
182 */
183 addModule(module) {
184 const chunkGraph = ChunkGraph.getChunkGraphForChunk(
185 this,
186 "Chunk.addModule",
187 "DEP_WEBPACK_CHUNK_ADD_MODULE"
188 );
189 if (chunkGraph.isModuleInChunk(module, this)) return false;
190 chunkGraph.connectChunkAndModule(this, module);
191 return true;
192 }
193
194 /**
195 * Removes the provided module from the chunk.

Callers

nothing calls this directly

Calls 3

getChunkGraphForChunkMethod · 0.80
isModuleInChunkMethod · 0.80
connectChunkAndModuleMethod · 0.80

Tested by

no test coverage detected