Sourcemaps and debugging
Five more short essays, part 3 of 5.
reference/svelte-v2.16.1/test/sourcemapsfixtures exist because Svelte's compiler genuinely transforms your source into different generated code, line by line -- a sourcemap is what lets a browser devtools panel point back at the
.sveltefile instead of the generated JS it's actually running.
ARKlight never generates code from a transformed intermediate form the way a
.sveltefile is rewritten.
arklight build --verboseprints each pipeline stage, and
--debugadds the full Python traceback on failure -- a trace through the compiler's own source, not a map back into a different source language.
Concern | Svelte v2 | ARKlight |
|---|---|---|
What the compiler emits | Generated JS, often with a sourcemap back to .svelte | Static HTML/CSS plus one fixed arklight.js runtime |
Debugging a build failure | Devtools via the sourcemap, or the bundler's own errors | --debug for the full Python traceback; --narrate for prose via Rei |
What the trace points at | Your component source, through the map | The compiler's own source, since nothing of yours survives transformed |
A real example: this patch tried wiring a markdown-authoring companion project into this site using a
# include <markdown.ARKlight>directive its own README describes. Building it against the ARKlight version installed for this patch fails at the preamble-resolution stage with a plain, specific message naming the two directive forms that do exist -- no sourcemap needed to find the problem. See
markdown authoringfor the full story.
This is also why ARKlight ships
sbom.txtwith every build: not a sourcemap, but a manifest of what actually went into the output, for a different kind of after-the-fact accounting -- more in
build tooling.
See
the CLIfor the exact flags, and
gotchasfor the error table most
--debugsessions end up confirming.
Styling model
No component-scoped stylesheet pass, because no component boundary survives into the output.
OpenPreprocessing
No pipeline stage for a second authoring language, because the entry file is already plain Python.
OpenCustom elements
No compile target for exporting a component as a reusable element outside its own build.
OpenBuild tooling
One CLI invocation instead of a bundler configuration, with sbom.txt standing in for build stats.
Open