Skip to content
Latchkey

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

Run this faster and cheaper on Latchkey managed runners. Start free →