Documentation
¶
Overview ¶
Package trace provides the trace command for mappa.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Cmd = &cobra.Command{
Use: "trace [file.html...]",
Short: "Trace HTML files and generate minimal import maps",
Long: `Trace HTML files to find all ES module imports and generate import maps.
For a single file, outputs an import map containing only the specifiers actually used.
For multiple files (via arguments or --glob), outputs NDJSON with one import map per line.
Use --format specifiers for debugging to see the raw trace output.`,
Example: ` # Trace a single HTML file
mappa trace index.html
# Trace multiple files (NDJSON output)
mappa trace file1.html file2.html file3.html
# Trace files matching a glob pattern
mappa trace --glob "_site/**/*.html"
# Parallel processing with custom worker count
mappa trace --glob "_site/**/*.html" -j 8
# Custom URL template for resolved paths
mappa trace index.html --template "/assets/{package}/{path}"
# Output as HTML script tag (single file only)
mappa trace index.html --format html`,
RunE: run,
}
Cmd is the trace cobra command that analyzes HTML files to find ES module imports and generates minimal import maps containing only the specifiers used.
Functions ¶
This section is empty.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.