Tooling concepts

Lazy loading and dynamic import boundaries

Try the free JavaScript compiler

Dynamic import returns a promise for a module namespace. A build tool can use a statically analyzable dynamic import as a boundary for splitting optional features into separate chunks. Do not construct import paths directly from untrusted input. Choose from an explicit known feature map and handle errors. Example type: javascript. Context: build-lab. Expected observation: start report loaded ready. See local fixture evidence.

Formal Syntax & Structure

javascript syntaxjavascript
console.log("start");const report = await import("./report.mjs");console.log(report.summary());

Working Example

Example Snippetjavascript
console.log("start");const report = await import("./report.mjs");console.log(report.summary());
JavaScript Reference