Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/bundler/deps.ts>postcss.SourceMapOptions

A Bundler with the web in mind.
Go to Latest
interface postcss.SourceMapOptions
import { type postcss } from "https://deno.land/x/bundler@0.6.5/deps.ts";
const { SourceMapOptions } = postcss;

Properties

optional
inline: boolean

Indicates that the source map should be embedded in the output CSS as a Base64-encoded comment. By default, it is true. But if all previous maps are external, not inline, PostCSS will not embed the map even if you do not set this option.

If you have an inline source map, the result.map property will be empty, as the source map will be contained within the text of result.css.

optional
prev:
| string
| boolean
| object
| ((file: string) => string)

Source map content from a previous processing step (e.g., Sass).

PostCSS will try to read the previous source map automatically (based on comments within the source CSS), but you can use this option to identify it manually.

If desired, you can omit the previous map with prev: false.

optional
sourcesContent: boolean

Indicates that PostCSS should set the origin content (e.g., Sass source) of the source map. By default, it is true. But if all previous maps do not contain sources content, PostCSS will also leave it out even if you do not set this option.

optional
annotation: string | boolean | ((file: string, root: Root) => string)

Indicates that PostCSS should add annotation comments to the CSS. By default, PostCSS will always add a comment with a path to the source map. PostCSS will not add annotations to CSS files that do not contain any comments.

By default, PostCSS presumes that you want to save the source map as opts.to + '.map' and will use this path in the annotation comment. A different path can be set by providing a string value for annotation.

If you have set inline: true, annotation cannot be disabled.

optional
from: string

Override from in map’s sources.

optional
absolute: boolean

Use absolute path in generated source map.