cssnano 8.0.4 → 8.0.6
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 +11 -8
- package/src/index.js +23 -23
- package/types/index.d.ts +2 -1
- package/types/index.d.ts.map +1 -1
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cssnano",
|
|
3
|
-
"version": "8.0.
|
|
4
|
-
"description": "A modular minifier, built on top of the PostCSS ecosystem.",
|
|
3
|
+
"version": "8.0.6",
|
|
4
|
+
"description": "A modular CSS minifier, built on top of the PostCSS ecosystem.",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": {
|
|
7
7
|
"types": "./types/index.d.ts",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"license": "MIT",
|
|
29
29
|
"dependencies": {
|
|
30
30
|
"lilconfig": "^3.1.3",
|
|
31
|
-
"cssnano-preset-default": "^8.0.
|
|
31
|
+
"cssnano-preset-default": "^8.0.6"
|
|
32
32
|
},
|
|
33
33
|
"homepage": "https://github.com/cssnano/cssnano",
|
|
34
34
|
"author": {
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
},
|
|
39
39
|
"repository": {
|
|
40
40
|
"type": "git",
|
|
41
|
-
"url": "cssnano/cssnano"
|
|
41
|
+
"url": "git+https://github.com/cssnano/cssnano.git"
|
|
42
42
|
},
|
|
43
43
|
"files": [
|
|
44
44
|
"src",
|
|
@@ -53,12 +53,15 @@
|
|
|
53
53
|
},
|
|
54
54
|
"devDependencies": {
|
|
55
55
|
"autoprefixer": "^10.5.4",
|
|
56
|
-
"postcss": "^8.5.
|
|
56
|
+
"postcss": "^8.5.26",
|
|
57
57
|
"postcss-font-magician": "^4.0.0",
|
|
58
|
-
"cssnano-preset-advanced": "^8.0.
|
|
59
|
-
"cssnano-preset-lite": "^5.0.
|
|
58
|
+
"cssnano-preset-advanced": "^8.0.6",
|
|
59
|
+
"cssnano-preset-lite": "^5.0.4"
|
|
60
60
|
},
|
|
61
61
|
"peerDependencies": {
|
|
62
|
-
"postcss": "^8.5.
|
|
62
|
+
"postcss": "^8.5.26"
|
|
63
|
+
},
|
|
64
|
+
"scripts": {
|
|
65
|
+
"test": "node --test"
|
|
63
66
|
}
|
|
64
67
|
}
|
package/src/index.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
const path = require('node:path');
|
|
3
|
-
/** @type {any} */
|
|
4
3
|
const postcss = require('postcss');
|
|
5
4
|
const { lilconfigSync } = require('lilconfig');
|
|
6
5
|
const defaultPreset = require('cssnano-preset-default');
|
|
@@ -28,7 +27,7 @@ function isResolvable(moduleId) {
|
|
|
28
27
|
* preset = function <- to be invoked
|
|
29
28
|
* preset = {plugins: []} <- already invoked function
|
|
30
29
|
*
|
|
31
|
-
* @param {
|
|
30
|
+
* @param {unknown} preset
|
|
32
31
|
* @return {[import('postcss').PluginCreator<any>, boolean | Record<string, any> | undefined][]}}
|
|
33
32
|
*/
|
|
34
33
|
function resolvePreset(preset) {
|
|
@@ -130,31 +129,32 @@ function cssnanoPlugin(options = {}) {
|
|
|
130
129
|
/** @type {Options} */ (options).preset = { plugins: [] };
|
|
131
130
|
}
|
|
132
131
|
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
require(pluginDef),
|
|
141
|
-
opts,
|
|
142
|
-
]);
|
|
143
|
-
} else {
|
|
144
|
-
/** @type {Options} */ (options).preset.plugins.push([
|
|
145
|
-
pluginDef,
|
|
146
|
-
opts,
|
|
147
|
-
]);
|
|
148
|
-
}
|
|
149
|
-
} else if (typeof plugin === 'string' && isResolvable(plugin)) {
|
|
132
|
+
const inputPlugins = /** @type {any[]} */ (
|
|
133
|
+
/** @type {Options} */ (options).plugins
|
|
134
|
+
);
|
|
135
|
+
for (const plugin of inputPlugins) {
|
|
136
|
+
if (Array.isArray(plugin)) {
|
|
137
|
+
const [pluginDef, opts = {}] = plugin;
|
|
138
|
+
if (typeof pluginDef === 'string' && isResolvable(pluginDef)) {
|
|
150
139
|
/** @type {Options} */ (options).preset.plugins.push([
|
|
151
|
-
require(
|
|
152
|
-
|
|
140
|
+
require(pluginDef),
|
|
141
|
+
opts,
|
|
153
142
|
]);
|
|
154
143
|
} else {
|
|
155
|
-
/** @type {Options} */ (options).preset.plugins.push([
|
|
144
|
+
/** @type {Options} */ (options).preset.plugins.push([
|
|
145
|
+
pluginDef,
|
|
146
|
+
opts,
|
|
147
|
+
]);
|
|
156
148
|
}
|
|
157
|
-
})
|
|
149
|
+
} else if (typeof plugin === 'string' && isResolvable(plugin)) {
|
|
150
|
+
/** @type {Options} */ (options).preset.plugins.push([
|
|
151
|
+
require(plugin),
|
|
152
|
+
{},
|
|
153
|
+
]);
|
|
154
|
+
} else {
|
|
155
|
+
/** @type {Options} */ (options).preset.plugins.push([plugin, {}]);
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
158
|
}
|
|
159
159
|
const plugins = [];
|
|
160
160
|
const nanoPlugins = resolveConfig(options);
|
package/types/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export = cssnanoPlugin;
|
|
2
|
+
import postcss = require('postcss');
|
|
2
3
|
export type Options = {
|
|
3
4
|
preset?: any;
|
|
4
5
|
plugins?: any[];
|
|
@@ -9,5 +10,5 @@ export type Options = {
|
|
|
9
10
|
* @param {Options=} options
|
|
10
11
|
* @return {import('postcss').Processor}
|
|
11
12
|
*/
|
|
12
|
-
declare function cssnanoPlugin(options?: {}):
|
|
13
|
+
declare function cssnanoPlugin(options?: {}): postcss.Processor;
|
|
13
14
|
//# sourceMappingURL=index.d.ts.map
|
package/types/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.js"],"names":[],"mappings":"SAkLiB,aAAa;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.js"],"names":[],"mappings":"SAkLiB,aAAa;OAhLxB,OAAO,WAAW,SAAS;AAM7B,YAAgE,OAAO,GAA7D;IAAC,MAAM,CAAC,EAAE,GAAG,CAAC;IAAC,OAAO,CAAC,EAAE,GAAG,EAAE,CAAC;IAAC,UAAU,CAAC,EAAE,MAAM,CAAA;CAAC,CAAS;AA6G3E;;;;GAIG;AACH,iBAAS,aAAa,CAAC,OAAO,KAAK,qBAqDlC"}
|