[6a3a178] | 1 | "use strict";
|
---|
| 2 |
|
---|
| 3 | Object.defineProperty(exports, "__esModule", {
|
---|
| 4 | value: true
|
---|
| 5 | });
|
---|
| 6 | exports.default = defaultPreset;
|
---|
| 7 |
|
---|
| 8 | var _cssDeclarationSorter = _interopRequireDefault(require("css-declaration-sorter"));
|
---|
| 9 |
|
---|
| 10 | var _postcssDiscardComments = _interopRequireDefault(require("postcss-discard-comments"));
|
---|
| 11 |
|
---|
| 12 | var _postcssReduceInitial = _interopRequireDefault(require("postcss-reduce-initial"));
|
---|
| 13 |
|
---|
| 14 | var _postcssMinifyGradients = _interopRequireDefault(require("postcss-minify-gradients"));
|
---|
| 15 |
|
---|
| 16 | var _postcssSvgo = _interopRequireDefault(require("postcss-svgo"));
|
---|
| 17 |
|
---|
| 18 | var _postcssReduceTransforms = _interopRequireDefault(require("postcss-reduce-transforms"));
|
---|
| 19 |
|
---|
| 20 | var _postcssConvertValues = _interopRequireDefault(require("postcss-convert-values"));
|
---|
| 21 |
|
---|
| 22 | var _postcssCalc = _interopRequireDefault(require("postcss-calc"));
|
---|
| 23 |
|
---|
| 24 | var _postcssColormin = _interopRequireDefault(require("postcss-colormin"));
|
---|
| 25 |
|
---|
| 26 | var _postcssOrderedValues = _interopRequireDefault(require("postcss-ordered-values"));
|
---|
| 27 |
|
---|
| 28 | var _postcssMinifySelectors = _interopRequireDefault(require("postcss-minify-selectors"));
|
---|
| 29 |
|
---|
| 30 | var _postcssMinifyParams = _interopRequireDefault(require("postcss-minify-params"));
|
---|
| 31 |
|
---|
| 32 | var _postcssNormalizeCharset = _interopRequireDefault(require("postcss-normalize-charset"));
|
---|
| 33 |
|
---|
| 34 | var _postcssMinifyFontValues = _interopRequireDefault(require("postcss-minify-font-values"));
|
---|
| 35 |
|
---|
| 36 | var _postcssNormalizeUrl = _interopRequireDefault(require("postcss-normalize-url"));
|
---|
| 37 |
|
---|
| 38 | var _postcssMergeLonghand = _interopRequireDefault(require("postcss-merge-longhand"));
|
---|
| 39 |
|
---|
| 40 | var _postcssDiscardDuplicates = _interopRequireDefault(require("postcss-discard-duplicates"));
|
---|
| 41 |
|
---|
| 42 | var _postcssDiscardOverridden = _interopRequireDefault(require("postcss-discard-overridden"));
|
---|
| 43 |
|
---|
| 44 | var _postcssNormalizeRepeatStyle = _interopRequireDefault(require("postcss-normalize-repeat-style"));
|
---|
| 45 |
|
---|
| 46 | var _postcssMergeRules = _interopRequireDefault(require("postcss-merge-rules"));
|
---|
| 47 |
|
---|
| 48 | var _postcssDiscardEmpty = _interopRequireDefault(require("postcss-discard-empty"));
|
---|
| 49 |
|
---|
| 50 | var _postcssUniqueSelectors = _interopRequireDefault(require("postcss-unique-selectors"));
|
---|
| 51 |
|
---|
| 52 | var _postcssNormalizeString = _interopRequireDefault(require("postcss-normalize-string"));
|
---|
| 53 |
|
---|
| 54 | var _postcssNormalizePositions = _interopRequireDefault(require("postcss-normalize-positions"));
|
---|
| 55 |
|
---|
| 56 | var _postcssNormalizeWhitespace = _interopRequireDefault(require("postcss-normalize-whitespace"));
|
---|
| 57 |
|
---|
| 58 | var _postcssNormalizeUnicode = _interopRequireDefault(require("postcss-normalize-unicode"));
|
---|
| 59 |
|
---|
| 60 | var _postcssNormalizeDisplayValues = _interopRequireDefault(require("postcss-normalize-display-values"));
|
---|
| 61 |
|
---|
| 62 | var _postcssNormalizeTimingFunctions = _interopRequireDefault(require("postcss-normalize-timing-functions"));
|
---|
| 63 |
|
---|
| 64 | var _cssnanoUtils = require("cssnano-utils");
|
---|
| 65 |
|
---|
| 66 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
---|
| 67 |
|
---|
| 68 | /**
|
---|
| 69 | * @author Ben Briggs
|
---|
| 70 | * @license MIT
|
---|
| 71 | * @module cssnano:preset:default
|
---|
| 72 | * @overview
|
---|
| 73 | *
|
---|
| 74 | * This default preset for cssnano only includes transforms that make no
|
---|
| 75 | * assumptions about your CSS other than what is passed in. In previous
|
---|
| 76 | * iterations of cssnano, assumptions were made about your CSS which caused
|
---|
| 77 | * output to look different in certain use cases, but not others. These
|
---|
| 78 | * transforms have been moved from the defaults to other presets, to make
|
---|
| 79 | * this preset require only minimal configuration.
|
---|
| 80 | */
|
---|
| 81 | const defaultOpts = {
|
---|
| 82 | convertValues: {
|
---|
| 83 | length: false
|
---|
| 84 | },
|
---|
| 85 | normalizeCharset: {
|
---|
| 86 | add: false
|
---|
| 87 | },
|
---|
| 88 | cssDeclarationSorter: {
|
---|
| 89 | keepOverrides: true
|
---|
| 90 | }
|
---|
| 91 | };
|
---|
| 92 |
|
---|
| 93 | function defaultPreset(opts = {}) {
|
---|
| 94 | const options = Object.assign({}, defaultOpts, opts);
|
---|
| 95 | const plugins = [[_postcssDiscardComments.default, options.discardComments], [_postcssMinifyGradients.default, options.minifyGradients], [_postcssReduceInitial.default, options.reduceInitial], [_postcssSvgo.default, options.svgo], [_postcssNormalizeDisplayValues.default, options.normalizeDisplayValues], [_postcssReduceTransforms.default, options.reduceTransforms], [_postcssColormin.default, options.colormin], [_postcssNormalizeTimingFunctions.default, options.normalizeTimingFunctions], [_postcssCalc.default, options.calc], [_postcssConvertValues.default, options.convertValues], [_postcssOrderedValues.default, options.orderedValues], [_postcssMinifySelectors.default, options.minifySelectors], [_postcssMinifyParams.default, options.minifyParams], [_postcssNormalizeCharset.default, options.normalizeCharset], [_postcssDiscardOverridden.default, options.discardOverridden], [_postcssNormalizeString.default, options.normalizeString], [_postcssNormalizeUnicode.default, options.normalizeUnicode], [_postcssMinifyFontValues.default, options.minifyFontValues], [_postcssNormalizeUrl.default, options.normalizeUrl], [_postcssNormalizeRepeatStyle.default, options.normalizeRepeatStyle], [_postcssNormalizePositions.default, options.normalizePositions], [_postcssNormalizeWhitespace.default, options.normalizeWhitespace], [_postcssMergeLonghand.default, options.mergeLonghand], [_postcssDiscardDuplicates.default, options.discardDuplicates], [_postcssMergeRules.default, options.mergeRules], [_postcssDiscardEmpty.default, options.discardEmpty], [_postcssUniqueSelectors.default, options.uniqueSelectors], [_cssDeclarationSorter.default, options.cssDeclarationSorter], [_cssnanoUtils.rawCache, options.rawCache]];
|
---|
| 96 | return {
|
---|
| 97 | plugins
|
---|
| 98 | };
|
---|
| 99 | }
|
---|
| 100 |
|
---|
| 101 | module.exports = exports.default; |
---|