From 0210c6ead7c61a65a68f766a633def101c54adb7 Mon Sep 17 00:00:00 2001 From: Martin Feckie Date: Tue, 18 Feb 2020 02:59:40 +1000 Subject: [PATCH] Add information about using with ember-cli-sass (#46) --- README.md | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/README.md b/README.md index 5b8b488..a44a55f 100644 --- a/README.md +++ b/README.md @@ -32,6 +32,32 @@ Other options would also go here along with `overrideBrowserslist`, `enabled` an You can read more about these settings and others [over on the Autoprefixer page](https://github.com/postcss/autoprefixer#options). +## Note on using with ember-cli-sass + +Autoprefixer doesn't play well with `.css.map` files, but it will work with embedded source maps. This means there are two options. + +If you want to disable CSS sourcemaps from ember-cli-sass update `ember-cli-build.js` to + +```js + sassOptions: { + // This tells ember-cli-sass to avoid generating the sourcemap file (like vendor.css.map) + sourceMap: false + }, +``` + +Alternatively, you may use embedded source maps. So we tell `ember-cli-sass` to embed the sourcemaps and then turn on sourcemaps with autoprefixer which will update the embedded sourcemap after adding prefixes. + +```js + sassOptions: { + sourceMapEmbed: true + }, + autoprefixer: { + enabled: true, + cascade: true, + sourcemap: true + } +``` + ## References - [Autoprefixer](https://github.com/postcss/autoprefixer) - [broccoli-autoprefixer](https://github.com/sindresorhus/broccoli-autoprefixer)