cssnano-preset-default 5.1.12 → 5.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +33 -30
- package/src/index.js +39 -2
- package/types/index.d.ts +98 -0
package/package.json
CHANGED
|
@@ -1,43 +1,45 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cssnano-preset-default",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.2.2",
|
|
4
4
|
"main": "src/index.js",
|
|
5
|
+
"types": "types/index.d.ts",
|
|
5
6
|
"description": "Safe defaults for cssnano which require minimal configuration.",
|
|
6
7
|
"files": [
|
|
7
8
|
"LICENSE-MIT",
|
|
8
|
-
"src"
|
|
9
|
+
"src",
|
|
10
|
+
"types"
|
|
9
11
|
],
|
|
10
12
|
"license": "MIT",
|
|
11
13
|
"dependencies": {
|
|
12
14
|
"css-declaration-sorter": "^6.0.3",
|
|
13
|
-
"cssnano-utils": "^3.0
|
|
14
|
-
"postcss-calc": "^8.2.
|
|
15
|
-
"postcss-colormin": "^5.
|
|
16
|
-
"postcss-convert-values": "^5.0
|
|
17
|
-
"postcss-discard-comments": "^5.
|
|
18
|
-
"postcss-discard-duplicates": "^5.0
|
|
19
|
-
"postcss-discard-empty": "^5.
|
|
20
|
-
"postcss-discard-overridden": "^5.0
|
|
21
|
-
"postcss-merge-longhand": "^5.0
|
|
22
|
-
"postcss-merge-rules": "^5.0
|
|
23
|
-
"postcss-minify-font-values": "^5.0
|
|
24
|
-
"postcss-minify-gradients": "^5.0
|
|
25
|
-
"postcss-minify-params": "^5.
|
|
26
|
-
"postcss-minify-selectors": "^5.
|
|
27
|
-
"postcss-normalize-charset": "^5.0
|
|
28
|
-
"postcss-normalize-display-values": "^5.0
|
|
29
|
-
"postcss-normalize-positions": "^5.0
|
|
30
|
-
"postcss-normalize-repeat-style": "^5.0
|
|
31
|
-
"postcss-normalize-string": "^5.0
|
|
32
|
-
"postcss-normalize-timing-functions": "^5.0
|
|
33
|
-
"postcss-normalize-unicode": "^5.0
|
|
34
|
-
"postcss-normalize-url": "^5.0
|
|
35
|
-
"postcss-normalize-whitespace": "^5.
|
|
36
|
-
"postcss-ordered-values": "^5.0
|
|
37
|
-
"postcss-reduce-initial": "^5.0
|
|
38
|
-
"postcss-reduce-transforms": "^5.0
|
|
39
|
-
"postcss-svgo": "^5.0
|
|
40
|
-
"postcss-unique-selectors": "^5.
|
|
15
|
+
"cssnano-utils": "^3.1.0",
|
|
16
|
+
"postcss-calc": "^8.2.3",
|
|
17
|
+
"postcss-colormin": "^5.3.0",
|
|
18
|
+
"postcss-convert-values": "^5.1.0",
|
|
19
|
+
"postcss-discard-comments": "^5.1.1",
|
|
20
|
+
"postcss-discard-duplicates": "^5.1.0",
|
|
21
|
+
"postcss-discard-empty": "^5.1.1",
|
|
22
|
+
"postcss-discard-overridden": "^5.1.0",
|
|
23
|
+
"postcss-merge-longhand": "^5.1.0",
|
|
24
|
+
"postcss-merge-rules": "^5.1.0",
|
|
25
|
+
"postcss-minify-font-values": "^5.1.0",
|
|
26
|
+
"postcss-minify-gradients": "^5.1.0",
|
|
27
|
+
"postcss-minify-params": "^5.1.1",
|
|
28
|
+
"postcss-minify-selectors": "^5.2.0",
|
|
29
|
+
"postcss-normalize-charset": "^5.1.0",
|
|
30
|
+
"postcss-normalize-display-values": "^5.1.0",
|
|
31
|
+
"postcss-normalize-positions": "^5.1.0",
|
|
32
|
+
"postcss-normalize-repeat-style": "^5.1.0",
|
|
33
|
+
"postcss-normalize-string": "^5.1.0",
|
|
34
|
+
"postcss-normalize-timing-functions": "^5.1.0",
|
|
35
|
+
"postcss-normalize-unicode": "^5.1.0",
|
|
36
|
+
"postcss-normalize-url": "^5.1.0",
|
|
37
|
+
"postcss-normalize-whitespace": "^5.1.1",
|
|
38
|
+
"postcss-ordered-values": "^5.1.0",
|
|
39
|
+
"postcss-reduce-initial": "^5.1.0",
|
|
40
|
+
"postcss-reduce-transforms": "^5.1.0",
|
|
41
|
+
"postcss-svgo": "^5.1.0",
|
|
42
|
+
"postcss-unique-selectors": "^5.1.1"
|
|
41
43
|
},
|
|
42
44
|
"author": {
|
|
43
45
|
"name": "Ben Briggs",
|
|
@@ -53,6 +55,7 @@
|
|
|
53
55
|
"node": "^10 || ^12 || >=14.0"
|
|
54
56
|
},
|
|
55
57
|
"devDependencies": {
|
|
58
|
+
"@types/css-declaration-sorter": "^6.0.1",
|
|
56
59
|
"postcss": "^8.2.15"
|
|
57
60
|
},
|
|
58
61
|
"peerDependencies": {
|
package/src/index.js
CHANGED
|
@@ -43,6 +43,36 @@ const postcssNormalizeDisplayValues = require('postcss-normalize-display-values'
|
|
|
43
43
|
const postcssNormalizeTimingFunctions = require('postcss-normalize-timing-functions');
|
|
44
44
|
const { rawCache } = require('cssnano-utils');
|
|
45
45
|
|
|
46
|
+
/** @typedef {{
|
|
47
|
+
discardComments?: false | import('postcss-discard-comments').Options & { exclude?: true},
|
|
48
|
+
reduceInitial?: false | { exclude?: true}
|
|
49
|
+
minifyGradients?: false | { exclude?: true}
|
|
50
|
+
svgo?: false | import('postcss-svgo').Options & { exclude?: true},
|
|
51
|
+
reduceTransforms?: false | { exclude?: true}
|
|
52
|
+
convertValues?: false | import('postcss-convert-values').Options & { exclude?: true},
|
|
53
|
+
calc?: false | import('postcss-calc').PostCssCalcOptions & { exclude?: true},
|
|
54
|
+
colormin?: false | Record<string, any> & { exclude?: true},
|
|
55
|
+
orderedValues?: false | { exclude?: true},
|
|
56
|
+
minifySelectors?: false | { exclude?: true},
|
|
57
|
+
minifyParams?: false | { exclude?: true},
|
|
58
|
+
normalizeCharset?: false | import('postcss-normalize-charset').Options & { exclude?: true},
|
|
59
|
+
minifyFontValues?: false | import('postcss-minify-font-values').Options & { exclude?: true},
|
|
60
|
+
normalizeUrl?: false | import('postcss-normalize-url').Options & { exclude?: true},
|
|
61
|
+
mergeLonghand?: false | { exclude?: true},
|
|
62
|
+
discardDuplicates?: false | { exclude?: true},
|
|
63
|
+
discardOverridden?: false | { exclude?: true},
|
|
64
|
+
normalizeRepeatStyle?: false | { exclude?: true},
|
|
65
|
+
mergeRules?: false | { exclude?: true},
|
|
66
|
+
discardEmpty?: false | { exclude?: true},
|
|
67
|
+
uniqueSelectors?: false | { exclude?: true},
|
|
68
|
+
normalizeString?: false | import('postcss-normalize-string').Options & { exclude?: true},
|
|
69
|
+
normalizePositions?: false | { exclude?: true},
|
|
70
|
+
normalizeWhitespace?: false| { exclude?: true},
|
|
71
|
+
normalizeUnicode?: false | { exclude?: true},
|
|
72
|
+
normalizeDisplayValues?: false | { exclude?: true},
|
|
73
|
+
normalizeTimingFunctions?: false | { exclude?: true},
|
|
74
|
+
rawCache?: false | { exclude?: true}}} Options */
|
|
75
|
+
|
|
46
76
|
const defaultOpts = {
|
|
47
77
|
convertValues: {
|
|
48
78
|
length: false,
|
|
@@ -55,9 +85,14 @@ const defaultOpts = {
|
|
|
55
85
|
},
|
|
56
86
|
};
|
|
57
87
|
|
|
58
|
-
|
|
88
|
+
/**
|
|
89
|
+
* @param {Options} opts
|
|
90
|
+
* @return {{plugins: [import('postcss').PluginCreator<any>, boolean | Record<string, any> | undefined][]}}
|
|
91
|
+
*/
|
|
92
|
+
function defaultPreset(opts = {}) {
|
|
59
93
|
const options = Object.assign({}, defaultOpts, opts);
|
|
60
94
|
|
|
95
|
+
/** @type {[import('postcss').PluginCreator<any>, boolean | Record<string, any> | undefined][]} **/
|
|
61
96
|
const plugins = [
|
|
62
97
|
[postcssDiscardComments, options.discardComments],
|
|
63
98
|
[postcssMinifyGradients, options.minifyGradients],
|
|
@@ -91,4 +126,6 @@ module.exports = function defaultPreset(opts = {}) {
|
|
|
91
126
|
];
|
|
92
127
|
|
|
93
128
|
return { plugins };
|
|
94
|
-
}
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
module.exports = defaultPreset;
|
package/types/index.d.ts
ADDED
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
export = defaultPreset;
|
|
2
|
+
/**
|
|
3
|
+
* @param {Options} opts
|
|
4
|
+
* @return {{plugins: [import('postcss').PluginCreator<any>, boolean | Record<string, any> | undefined][]}}
|
|
5
|
+
*/
|
|
6
|
+
declare function defaultPreset(opts?: Options): {
|
|
7
|
+
plugins: [import('postcss').PluginCreator<any>, boolean | Record<string, any> | undefined][];
|
|
8
|
+
};
|
|
9
|
+
declare namespace defaultPreset {
|
|
10
|
+
export { Options };
|
|
11
|
+
}
|
|
12
|
+
type Options = {
|
|
13
|
+
discardComments?: false | import('postcss-discard-comments').Options & {
|
|
14
|
+
exclude?: true;
|
|
15
|
+
};
|
|
16
|
+
reduceInitial?: false | {
|
|
17
|
+
exclude?: true;
|
|
18
|
+
};
|
|
19
|
+
minifyGradients?: false | {
|
|
20
|
+
exclude?: true;
|
|
21
|
+
};
|
|
22
|
+
svgo?: false | import('postcss-svgo').Options & {
|
|
23
|
+
exclude?: true;
|
|
24
|
+
};
|
|
25
|
+
reduceTransforms?: false | {
|
|
26
|
+
exclude?: true;
|
|
27
|
+
};
|
|
28
|
+
convertValues?: false | import('postcss-convert-values').Options & {
|
|
29
|
+
exclude?: true;
|
|
30
|
+
};
|
|
31
|
+
calc?: false | import('postcss-calc').PostCssCalcOptions & {
|
|
32
|
+
exclude?: true;
|
|
33
|
+
};
|
|
34
|
+
colormin?: false | (Record<string, any> & {
|
|
35
|
+
exclude?: true;
|
|
36
|
+
});
|
|
37
|
+
orderedValues?: false | {
|
|
38
|
+
exclude?: true;
|
|
39
|
+
};
|
|
40
|
+
minifySelectors?: false | {
|
|
41
|
+
exclude?: true;
|
|
42
|
+
};
|
|
43
|
+
minifyParams?: false | {
|
|
44
|
+
exclude?: true;
|
|
45
|
+
};
|
|
46
|
+
normalizeCharset?: false | import('postcss-normalize-charset').Options & {
|
|
47
|
+
exclude?: true;
|
|
48
|
+
};
|
|
49
|
+
minifyFontValues?: false | import('postcss-minify-font-values').Options & {
|
|
50
|
+
exclude?: true;
|
|
51
|
+
};
|
|
52
|
+
normalizeUrl?: false | import('postcss-normalize-url').Options & {
|
|
53
|
+
exclude?: true;
|
|
54
|
+
};
|
|
55
|
+
mergeLonghand?: false | {
|
|
56
|
+
exclude?: true;
|
|
57
|
+
};
|
|
58
|
+
discardDuplicates?: false | {
|
|
59
|
+
exclude?: true;
|
|
60
|
+
};
|
|
61
|
+
discardOverridden?: false | {
|
|
62
|
+
exclude?: true;
|
|
63
|
+
};
|
|
64
|
+
normalizeRepeatStyle?: false | {
|
|
65
|
+
exclude?: true;
|
|
66
|
+
};
|
|
67
|
+
mergeRules?: false | {
|
|
68
|
+
exclude?: true;
|
|
69
|
+
};
|
|
70
|
+
discardEmpty?: false | {
|
|
71
|
+
exclude?: true;
|
|
72
|
+
};
|
|
73
|
+
uniqueSelectors?: false | {
|
|
74
|
+
exclude?: true;
|
|
75
|
+
};
|
|
76
|
+
normalizeString?: false | import('postcss-normalize-string').Options & {
|
|
77
|
+
exclude?: true;
|
|
78
|
+
};
|
|
79
|
+
normalizePositions?: false | {
|
|
80
|
+
exclude?: true;
|
|
81
|
+
};
|
|
82
|
+
normalizeWhitespace?: false | {
|
|
83
|
+
exclude?: true;
|
|
84
|
+
};
|
|
85
|
+
normalizeUnicode?: false | {
|
|
86
|
+
exclude?: true;
|
|
87
|
+
};
|
|
88
|
+
normalizeDisplayValues?: false | {
|
|
89
|
+
exclude?: true;
|
|
90
|
+
};
|
|
91
|
+
normalizeTimingFunctions?: false | {
|
|
92
|
+
exclude?: true;
|
|
93
|
+
};
|
|
94
|
+
rawCache?: false | {
|
|
95
|
+
exclude?: true;
|
|
96
|
+
};
|
|
97
|
+
};
|
|
98
|
+
import { rawCache } from "cssnano-utils";
|