TOOLING · COMPLETE
Source maps
Trace production CSS back to the entry and every local CSS import, even after Coordiation generates layers, lowers nesting, adds prefixes, and minifies the result.
Coordiation emits standard Source Map v3 JSON. Authored rules retain CSS origins; generated framework layers map to the entry marker and recognizable theme or custom-definition segments retain their defining CSS source.
COMPOSED PIPELINE
One map follows every stage
The final consumer receives a single composed map instead of disconnected stage-specific files.
- 01
Imports: associate bundled rules and definitions with the entry or resolved local CSS file.
- 02
Framework: map authored CSS directly and generated layers to the closest framework definition or
@coordiationmarker. - 03
Transforms: extend mappings while nesting is lowered and target-specific prefixes are emitted.
- 04
Optimization: preserve source identities and mappings in minified production output.
Enable maps in the production API
Supply a real entry filename. outputFilename controls the map's generated-file identity.
const result = await compileWithToolchain(inputCss, candidates, {
filename: "/project/src/coordiation.css",
outputFilename: "/project/dist/coordiation.css",
sourceMap: true,
toolchain: { minify: true },
});
await writeFile("dist/coordiation.css", result.css);
await writeFile("dist/coordiation.css.map", result.map);result.map is a JSON string. result.toolchain.sourceMap is a compact machine-readable manifest of enabled state, source identities, and embedded-content policy.
Control embedded source text
Original CSS is embedded by default so DevTools can display sources without separately fetching project files.
sourceMap: {
sourcesContent: false,
}Disable sourcesContent when source identities and line mappings are useful but original CSS must not be embedded in the artifact.
Choose external or inline CLI output
External maps are suitable for deployed debugging. Inline maps keep local or portable output self-contained.
coordiation-css \
-i src/coordiation.css \
-o dist/coordiation.css \
-c src \
--sourcemapcoordiation-css \
-i src/coordiation.css \
-o dist/coordiation.css \
-c src \
--sourcemap-inline \
--no-sources-contentExternal mode writes coordiation.css.map and adds a relative annotation to the CSS. Watch mode refreshes the map before replacing the CSS output.
Return native Vite module maps
Enable sourceMap on the official adapter. The virtual CSS loader returns Vite's conventional { code, map } result.
coordiation({
content: ["src"],
cssFile: "src/coordiation.css",
sourceMap: true,
})Compose with a PostCSS runner
When the runner requests a map, the adapter enables Coordiation mapping automatically and attaches it as the previous map for generated nodes.
const result = await postcss([coordiation({ content: ["src"] })]).process(css, {
from: "src/app.css",
to: "dist/app.css",
map: { inline: false },
});The adapter also publishes a coordiation-source-map result message for build diagnostics and agent inspection.
Inspect before describing coverage
{
enabled: true,
sourcesContent: true,
sources: [
"project/src/coordiation.css",
"project/src/theme.css",
"project/src/components.css"
]
}The source list describes CSS origins. Scanned HTML, JSX, Vue, or .coord templates are candidate-discovery inputs and are not presented as CSS source locations.
BOUNDARIES
Keep mappings useful and honest
Source maps explain generated CSS, not runtime DOM behavior.
- Use literal local imports and a real filename so every source identity is stable.
- Generated utilities without a CSS-first definition map to the
@coordiationmarker. - Template files are scanner dependencies, not CSS sources.
- Do not expose embedded source text in public artifacts when project policy forbids it.
- Read the actual manifest before claiming which imported files are mapped.
AI GENERATION CONTRACT
Generate the right delivery mode
Agents should match map output to the consumer rather than enabling an unused artifact.
- Prefer Vite's returned map and PostCSS runner maps over writing duplicate files.
- Use external CLI maps for deployed debugging and inline maps for self-contained local output.
- Set
sourcesContent: falsewhen source text must not be embedded. - Preserve
filename,outputFilename, and literal imports. - Never infer template-to-CSS mappings; only CSS origins are represented.
