MCPcopy
hub / github.com/webpack/webpack / entryModule

Method entryModule

lib/Chunk.js:143–160  ·  view source on GitHub ↗

* Returns entry module. * @deprecated * @returns {Module | undefined} entry module

()

Source from the content-addressed store, hash-verified

141 * @returns {Module | undefined} entry module
142 */
143 get entryModule() {
144 const entryModules = [
145 ...ChunkGraph.getChunkGraphForChunk(
146 this,
147 "Chunk.entryModule",
148 "DEP_WEBPACK_CHUNK_ENTRY_MODULE"
149 ).getChunkEntryModulesIterable(this)
150 ];
151 if (entryModules.length === 0) {
152 return undefined;
153 } else if (entryModules.length === 1) {
154 return entryModules[0];
155 }
156
157 throw new Error(
158 "Module.entryModule: Multiple entry modules are not supported by the deprecated API (Use the new ChunkGroup API)"
159 );
160 }
161
162 /**
163 * Checks whether this chunk has an entry module.

Callers

nothing calls this directly

Calls 2

getChunkGraphForChunkMethod · 0.80

Tested by

no test coverage detected