Home / Function/ addModuleImport() — astro Function Reference

addModuleImport() — astro Function Reference

Architecture documentation for the addModuleImport() function in mutable-data-store.ts from the astro codebase.

Entity Profile

Dependency Diagram

graph TD
  3a21f321_74af_4ffd_6753_e5d73c2415a9["addModuleImport()"]
  ecb98618_124a_e276_dd98_561beaedc6ea["MutableDataStore"]
  3a21f321_74af_4ffd_6753_e5d73c2415a9 -->|defined in| ecb98618_124a_e276_dd98_561beaedc6ea
  f03b05d5_a06a_1438_1154_d1d6dcdbbdb9["scopedStore()"]
  f03b05d5_a06a_1438_1154_d1d6dcdbbdb9 -->|calls| 3a21f321_74af_4ffd_6753_e5d73c2415a9
  0387bc4c_3a64_034b_f25c_ea4d3808bd47["set()"]
  3a21f321_74af_4ffd_6753_e5d73c2415a9 -->|calls| 0387bc4c_3a64_034b_f25c_ea4d3808bd47
  style 3a21f321_74af_4ffd_6753_e5d73c2415a9 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/astro/src/content/mutable-data-store.ts lines 78–87

	addModuleImport(fileName: string) {
		const id = contentModuleToId(fileName);
		if (id) {
			this.#moduleImports.set(fileName, id);
			// We debounce the writes to disk because addAssetImport is called for every image in every file,
			// and can be called many times in quick succession by a filesystem watcher. We only want to write
			// the file once, after all the imports have been added.
			this.#writeModulesImportsDebounced();
		}
	}

Subdomains

Calls

Called By

Frequently Asked Questions

What does addModuleImport() do?
addModuleImport() is a function in the astro codebase, defined in packages/astro/src/content/mutable-data-store.ts.
Where is addModuleImport() defined?
addModuleImport() is defined in packages/astro/src/content/mutable-data-store.ts at line 78.
What does addModuleImport() call?
addModuleImport() calls 1 function(s): set.
What calls addModuleImport()?
addModuleImport() is called by 1 function(s): scopedStore.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free