MCPcopy Index your code
hub / github.com/rollup/rollup / addEntryWithImplicitDependants

Method addEntryWithImplicitDependants

src/ModuleLoader.ts:227–271  ·  view source on GitHub ↗
(
		unresolvedModule: UnresolvedModule,
		implicitlyLoadedAfter: readonly string[]
	)

Source from the content-addressed store, hash-verified

225 );
226
227 private addEntryWithImplicitDependants(
228 unresolvedModule: UnresolvedModule,
229 implicitlyLoadedAfter: readonly string[]
230 ): Promise<Module> {
231 return this.extendLoadModulesPromise(
232 this.loadEntryModule(
233 unresolvedModule.id,
234 false,
235 unresolvedModule.importer,
236 null,
237 undefined,
238 undefined
239 ).then(async entryModule => {
240 addChunkNamesToModule(entryModule, unresolvedModule, false);
241 if (!entryModule.info.isEntry) {
242 const implicitlyLoadedAfterModules = await Promise.all(
243 implicitlyLoadedAfter.map(id =>
244 this.loadEntryModule(
245 id,
246 false,
247 unresolvedModule.importer,
248 entryModule.id,
249 undefined,
250 undefined
251 )
252 )
253 );
254 // We need to check again if this is still an entry module as these
255 // changes need to be performed atomically to avoid race conditions
256 // if the same module is re-emitted as an entry module.
257 // The inverse changes happen in "handleExistingModule"
258 if (!entryModule.info.isEntry) {
259 this.implicitEntryModules.add(entryModule);
260 for (const module of implicitlyLoadedAfterModules) {
261 entryModule.implicitlyLoadedAfter.add(module);
262 }
263 for (const dependent of entryModule.implicitlyLoadedAfter) {
264 dependent.implicitlyLoadedBefore.add(entryModule);
265 }
266 }
267 }
268 return entryModule;
269 })
270 );
271 }
272
273 private async addModuleSource(
274 id: string,

Callers 1

emitChunkMethod · 0.95

Calls 4

loadEntryModuleMethod · 0.95
addChunkNamesToModuleFunction · 0.85
addMethod · 0.80

Tested by

no test coverage detected