Dynamic Import - CI/CD Glossary Definition
A dynamic import loads a module on demand at runtime and doubles as a code-splitting point for bundlers.
A dynamic import is the import() expression that loads a module at runtime and returns a promise, rather than importing it statically at the top of a file. Bundlers use it as a code-splitting boundary.
Writing const mod = await import("./heavy.js") tells the bundler to place that module in a separate chunk fetched only when the code runs. This underpins lazy loading. In CI, a build will fail if the dynamically imported path cannot be resolved.
Related guides
Code Splitting - CI/CD Glossary DefinitionCode Splitting: Code splitting breaks a bundle into multiple smaller chunks that load on demand rather than a…
Lazy Loading - CI/CD Glossary DefinitionLazy Loading: Lazy loading defers loading a resource or module until it is actually needed, rather than at in…
Chunk - CI/CD Glossary DefinitionChunk: A chunk is one of the output files a bundler produces when it splits code. Each chunk groups a set of…