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