Static Import

Noun · Development

Definitions

  1. An import declaration evaluated at parse time before any code executes, allowing the module bundler or runtime to resolve the dependency graph statically. In JavaScript, `import x from 'y'` is static, in contrast to the dynamic `import()` function which loads modules at runtime.

    In plain English: Telling your program upfront which other code files it needs, so everything is loaded and ready before the program starts running.

    Example: "Use a static import for the core library so the bundler can tree-shake unused exports at build time."

Related Terms