From cf0af2807108e43f4858574b5d22dfaec0630d80 Mon Sep 17 00:00:00 2001 From: Lukas Waslowski Date: Wed, 7 Feb 2024 15:50:45 +0100 Subject: [PATCH] Update documentation on source maps in README.md PostCSS only supports passing an existing source map as { map: { prev: "..." } }, not directly as { map: "..." }. See https://github.com/postcss/postcss/blob/8.0.3/lib/postcss.d.ts#L235. --- README.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 08fad16..e90102e 100644 --- a/README.md +++ b/README.md @@ -202,7 +202,7 @@ Autoprefixer will generate a source map if you set `map` option to `true` in `process` method. You must set input and output CSS files paths (by `from` and `to` options) -to generate correct map. +to generate a correct map. ```ruby result = AutoprefixerRails.process(css, @@ -212,11 +212,12 @@ result = AutoprefixerRails.process(css, ``` Autoprefixer can also modify previous source map (for example, from Sass -compilation). Just set original source map content (as string) to `map` option: +compilation). Just set original source map content (as string) as `prev` +in the `map` option. ```ruby result = AutoprefixerRails.process(css, { - map: File.read('main.sass.css.map'), + map: { prev: File.read('main.sass.css.map') }, from: 'main.sass.css', to: 'main.min.css')