Post\+CSS has great \href{http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/}{\texttt{ source maps}} support. It can read and interpret maps from previous transformation steps, autodetect the format that you expect, and output both external and inline maps.

To ensure that you generate an accurate source map, you must indicate the input and output CSS~file~paths — using the options {\ttfamily from} and {\ttfamily to}, respectively.

To generate a new source map with the default options, simply set {\ttfamily map\+: true}. This will generate an~inline source map that contains the source content. If you don’t want the map inlined, you~can~set {\ttfamily map.\+inline\+: false}.


\begin{DoxyCode}{0}
\DoxyCodeLine{processor}
\DoxyCodeLine{  .process(css, \{}
\DoxyCodeLine{    from: 'app.sass.css',}
\DoxyCodeLine{    to:   'app.css',}
\DoxyCodeLine{    map: \{ inline: false \}}
\DoxyCodeLine{  \})}
\DoxyCodeLine{  .then(result => \{}
\DoxyCodeLine{      result.map //=> '\{ "{}version"{}:3,}
\DoxyCodeLine{                 //      "{}file"{}:"{}app.css"{},}
\DoxyCodeLine{                 //      "{}sources"{}:["{}app.sass"{}],}
\DoxyCodeLine{                 //       "{}mappings"{}:"{}AAAA,KAAI"{} \}'}
\DoxyCodeLine{  \}) }

\end{DoxyCode}


If Post\+CSS finds source maps from a previous transformation, it will automatically update that~source~map with the same options.\hypertarget{md_sfcode_node_modules_postcss_docs_source_maps_autotoc_md20720}{}\doxysection{Options}\label{md_sfcode_node_modules_postcss_docs_source_maps_autotoc_md20720}
If you want more control over source map generation, you can define the {\ttfamily map} option as an object with~the following parameters\+:


\begin{DoxyItemize}
\item {\ttfamily inline} boolean\+: indicates that the source map should be embedded in the output CSS as~a~Base64-\/encoded comment. By default, it is {\ttfamily true}. But if all previous maps are external, not~inline, Post\+CSS will not embed the map even if you do not set this option.

If you have an inline source map, the {\ttfamily result.\+map} property will be empty, as the source map will~be contained within the text of {\ttfamily result.\+css}.
\item {\ttfamily prev} string, object, boolean or function\+: source map content from a previous processing step (for~example,~Sass compilation). Post\+CSS 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 {\ttfamily prev\+: false}.
\item {\ttfamily sources\+Content} boolean\+: indicates that Post\+CSS should set the origin content (for~example,~Sass~source) of the source map. By default, it is {\ttfamily true}. But if all previous maps do not contain sources content, Post\+CSS will also leave it out even if you do not set this option.
\item {\ttfamily annotation} boolean or string\+: indicates that Post\+CSS should add annotation comments to~the~CSS. By default, Post\+CSS will always add a comment with a path to the source map. Post\+CSS will not add annotations to CSS files that do not contain any comments.

By default, Post\+CSS presumes that you want to save the source map as `opts.\+to + '.map\textquotesingle{}{\ttfamily 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 {\ttfamily inline\+: true}, annotation cannot be disabled.
\item {\ttfamily from} string\+: by default, Post\+CSS will set the {\ttfamily sources} property of the map to the value of the {\ttfamily from} option. If you want to override this behaviour, you can use {\ttfamily map.\+from} to explicitly set the source map\textquotesingle{}s {\ttfamily sources} property. Path should be absolute or relative from generated file ({\ttfamily to} option in {\ttfamily process()} method). 
\end{DoxyItemize}