Skip to content

Commit 311c575

Browse files
committed
Docs: Mention position option for source map generation
1 parent 336f27e commit 311c575

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Readme.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,15 @@ To get compressed output:
1919

2020
To get a source map:
2121

22+
var ast = parse('body { font-size: 12px; }', {position: true});
2223
var result = stringify(ast, {sourcemap: true});
2324

2425
result.code // string with CSS
2526
result.map // source map
2627

28+
Note that the AST should contain position information (`position` option set to
29+
`true`).
30+
2731
## Performance
2832

2933
Formats 15,000 lines of CSS (2mb) in 23ms on my macbook air.

0 commit comments

Comments
 (0)