From a0657cc32f6ef831af1c663972b0e84b5b4b59a9 Mon Sep 17 00:00:00 2001 From: snewcomer Date: Mon, 17 Feb 2020 10:05:09 -0800 Subject: [PATCH] Update README --- README.md | 43 ++++++++++++++++++++++++++++++------------- 1 file changed, 30 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index a44a55f..1a61866 100644 --- a/README.md +++ b/README.md @@ -36,26 +36,43 @@ You can read more about these settings and others [over on the Autoprefixer page 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 +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 - }, + 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 - } + sassOptions: { + sourceMapEmbed: true + }, + autoprefixer: { + enabled: true, + cascade: true, + sourcemap: true + } +``` + +Also note you can optionally disable in production! + +```js + const envIsProduction = (process.env.EMBER_ENV === 'production'); + + ... + + sassOptions: { + sourceMapEmbed: !envIsProduction + }, + autoprefixer: { + enabled: true, + cascade: true, + sourcemap: !envIsProduction + } ``` ## References