Home / Function/ imports() — svelte Function Reference

imports() — svelte Function Reference

Architecture documentation for the imports() function in builders.js from the svelte codebase.

Entity Profile

Dependency Diagram

graph TD
  6735c366_3d96_f2b9_2af0_5b7905e191a6["imports()"]
  18e3101f_3e97_34c3_7373_b587af4b78e1["builders.js"]
  6735c366_3d96_f2b9_2af0_5b7905e191a6 -->|defined in| 18e3101f_3e97_34c3_7373_b587af4b78e1
  36ba2c12_e83e_4a48_07b2_d8eda31d4eed["literal()"]
  6735c366_3d96_f2b9_2af0_5b7905e191a6 -->|calls| 36ba2c12_e83e_4a48_07b2_d8eda31d4eed
  be1e2e2e_efd8_0ff6_cec1_bc18ea37e21e["id()"]
  6735c366_3d96_f2b9_2af0_5b7905e191a6 -->|calls| be1e2e2e_efd8_0ff6_cec1_bc18ea37e21e
  style 6735c366_3d96_f2b9_2af0_5b7905e191a6 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/svelte/src/compiler/utils/builders.js lines 644–655

export function imports(parts, source) {
	return {
		type: 'ImportDeclaration',
		attributes: [],
		source: literal(source),
		specifiers: parts.map((p) => ({
			type: 'ImportSpecifier',
			imported: id(p[0]),
			local: id(p[1])
		}))
	};
}

Domain

Subdomains

Frequently Asked Questions

What does imports() do?
imports() is a function in the svelte codebase, defined in packages/svelte/src/compiler/utils/builders.js.
Where is imports() defined?
imports() is defined in packages/svelte/src/compiler/utils/builders.js at line 644.
What does imports() call?
imports() calls 2 function(s): id, literal.

Analyze Your Own Codebase

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

Try Supermodel Free