pub struct RequireCallInfo {
pub source: String,
pub span: Span,
pub source_span: Span,
pub destructured_names: Vec<String>,
pub local_name: Option<String>,
pub is_type_only: bool,
}Expand description
A require() call.
Fields§
§source: StringThe require specifier.
span: SpanSource span of the require() call.
source_span: SpanSource span of the specifier string-literal argument (including its
quotes), e.g. the './x' in require('./x'). Used to anchor an
unresolved-import diagnostic squiggly under the specifier rather than
the require keyword. Span::default() when the argument is not a
plain string literal.
destructured_names: Vec<String>Names destructured from the require() result.
local_name: Option<String>The local variable name for const x = require(...).
is_type_only: booltrue for import type X = require('...'), the one require spelling
TypeScript erases entirely: the emitted JavaScript contains no
require call, so the target is a type-space reference and never a
runtime dependency. Always false for const x = require(...), which
has no type-only spelling. Read by dependency classification so a
type-only devDependency is not reported as production usage.