Skip to main content

Module parse

Module parse 

Source

Structs§

IdentCollector
Collects identifier names and their byte positions from an AST. This is used to populate the names field in source maps. Based on swc_compiler_base::IdentCollector.
InlineSourcesContentConfig
A config to generate a source map which includes the source content of every source file. SWC doesn’t inline sources content by default when generating a sourcemap, so we need to provide a custom config to do it.

Enums§

ParseResult

Functions§

generate_js_source_map
Generates a [StructuredSourceMap] for the transformed code, whose sourcesContent entries are individual shared ropes instead of being embedded in the serialized JSON. This keeps later sources URL rewrites and map embedding from copying the source text of every module. Serialize with [StructuredSourceMap::to_rope] where raw bytes are needed.
parse
parse_from_rope
Re-parses a module directly from saved bytes, bypassing source.content().