accelerator-core
Version:
[](https://travis-ci.org/furkleindustries/accelerator-core)
23 lines (21 loc) • 692 B
JavaScript
import OptimizeCSSAssetsPlugin from 'optimize-css-assets-webpack-plugin';
import safePostCssParser from 'postcss-safe-parser';
export function getCssMinimizer(shouldUseSourceMap) {
return new OptimizeCSSAssetsPlugin({
cssProcessorOptions: {
parser: safePostCssParser,
map: (
shouldUseSourceMap ?
{
// `inline: false` forces the sourcemap to be output into a
// separate file
inline: false,
// `annotation: true` appends the sourceMappingURL to the end of
// the css file, helping the browser find the sourcemap
annotation: true,
} :
false
),
},
});
}