cssnano-preset-lite 5.0.6 → 6.0.1
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/README.md +8 -7
- package/package.json +9 -9
- package/src/index.js +7 -6
- package/types/index.d.ts +2 -1
- package/types/index.d.ts.map +1 -1
package/README.md
CHANGED
|
@@ -39,7 +39,7 @@ If you don't have npm then [check out this installation tutorial](https://npmjs.
|
|
|
39
39
|
|
|
40
40
|
### Configuration
|
|
41
41
|
|
|
42
|
-
If you would like to use the default configuration, then you don't need
|
|
42
|
+
If you would like to use the default configuration, then you don't need any additional configuration.
|
|
43
43
|
|
|
44
44
|
But should you wish to customise this, you can pass an array with the second parameter as the options object to use. For example, to remove all comments:
|
|
45
45
|
|
|
@@ -55,7 +55,8 @@ But should you wish to customise this, you can pass an array with the second par
|
|
|
55
55
|
}
|
|
56
56
|
```
|
|
57
57
|
|
|
58
|
-
Depending on your usage, the JSON configuration might not work for you, such as in cases where you would like to use options with customisable function parameters.
|
|
58
|
+
Depending on your usage, the JSON configuration might not work for you, such as in cases where you would like to use options with customisable function parameters.
|
|
59
|
+
For this use case, create use a `cssnano.config.js`. You can then load a preset and export it with your custom parameters:
|
|
59
60
|
|
|
60
61
|
```js
|
|
61
62
|
const defaultPreset = require('cssnano-preset-lite');
|
|
@@ -71,24 +72,24 @@ Note that you may wish to publish your own preset to npm for reusability, should
|
|
|
71
72
|
|
|
72
73
|
## Plugins
|
|
73
74
|
|
|
74
|
-
### [`cssnano-utils`](https://github.com/cssnano/cssnano/tree/
|
|
75
|
+
### [`cssnano-utils`](https://github.com/cssnano/cssnano/tree/main/packages/cssnano-utils)
|
|
75
76
|
|
|
76
77
|
> Utility methods used by cssnano
|
|
77
78
|
|
|
78
79
|
|
|
79
|
-
### [`postcss-discard-comments`](https://github.com/cssnano/cssnano/tree/
|
|
80
|
+
### [`postcss-discard-comments`](https://github.com/cssnano/cssnano/tree/main/packages/postcss-discard-comments)
|
|
80
81
|
|
|
81
82
|
> Discard comments in your CSS files with PostCSS.
|
|
82
83
|
|
|
83
84
|
This plugin is loaded with its default configuration.
|
|
84
85
|
|
|
85
|
-
### [`postcss-discard-empty`](https://github.com/cssnano/cssnano/tree/
|
|
86
|
+
### [`postcss-discard-empty`](https://github.com/cssnano/cssnano/tree/main/packages/postcss-discard-empty)
|
|
86
87
|
|
|
87
88
|
> Discard empty rules and values with PostCSS.
|
|
88
89
|
|
|
89
90
|
This plugin is loaded with its default configuration.
|
|
90
91
|
|
|
91
|
-
### [`postcss-normalize-whitespace`](https://github.com/cssnano/cssnano/tree/
|
|
92
|
+
### [`postcss-normalize-whitespace`](https://github.com/cssnano/cssnano/tree/main/packages/postcss-normalize-whitespace)
|
|
92
93
|
|
|
93
94
|
> Trim whitespace inside and around CSS rules & declarations.
|
|
94
95
|
|
|
@@ -97,4 +98,4 @@ This plugin is loaded with its default configuration.
|
|
|
97
98
|
|
|
98
99
|
## Contributors
|
|
99
100
|
|
|
100
|
-
See [CONTRIBUTORS.md](https://github.com/cssnano/cssnano/blob/
|
|
101
|
+
See [CONTRIBUTORS.md](https://github.com/cssnano/cssnano/blob/main/CONTRIBUTORS.md).
|
package/package.json
CHANGED
|
@@ -1,17 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cssnano-preset-lite",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "6.0.1",
|
|
4
4
|
"description": "Safe and minimum transformation",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": {
|
|
7
7
|
"types": "./types/index.d.ts",
|
|
8
8
|
"default": "./src/index.js"
|
|
9
9
|
},
|
|
10
|
-
"./src": "./src/index.js",
|
|
11
|
-
"./src/index": "./src/index.js",
|
|
12
|
-
"./src/index.js": "./src/index.js",
|
|
13
10
|
"./package.json": "./package.json"
|
|
14
11
|
},
|
|
12
|
+
"main": "./src/index.js",
|
|
13
|
+
"types": "./types/index.d.ts",
|
|
15
14
|
"files": [
|
|
16
15
|
"LICENSE-MIT",
|
|
17
16
|
"src",
|
|
@@ -19,10 +18,10 @@
|
|
|
19
18
|
],
|
|
20
19
|
"license": "MIT",
|
|
21
20
|
"dependencies": {
|
|
22
|
-
"cssnano-utils": "^
|
|
23
|
-
"postcss-discard-comments": "^
|
|
24
|
-
"postcss-discard-empty": "^
|
|
25
|
-
"postcss-normalize-whitespace": "^
|
|
21
|
+
"cssnano-utils": "^7.0.1",
|
|
22
|
+
"postcss-discard-comments": "^9.0.1",
|
|
23
|
+
"postcss-discard-empty": "^9.0.1",
|
|
24
|
+
"postcss-normalize-whitespace": "^9.0.1"
|
|
26
25
|
},
|
|
27
26
|
"repository": {
|
|
28
27
|
"type": "git",
|
|
@@ -33,7 +32,7 @@
|
|
|
33
32
|
"url": "https://github.com/cssnano/cssnano/issues"
|
|
34
33
|
},
|
|
35
34
|
"engines": {
|
|
36
|
-
"node": "^22.
|
|
35
|
+
"node": "^22.22.3 || ^24.15.0 || >=26.0"
|
|
37
36
|
},
|
|
38
37
|
"devDependencies": {
|
|
39
38
|
"postcss": "^8.5.26"
|
|
@@ -41,6 +40,7 @@
|
|
|
41
40
|
"peerDependencies": {
|
|
42
41
|
"postcss": "^8.5.26"
|
|
43
42
|
},
|
|
43
|
+
"type": "module",
|
|
44
44
|
"scripts": {
|
|
45
45
|
"test": "node --test"
|
|
46
46
|
}
|
package/src/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const { rawCache } = require('cssnano-utils');
|
|
1
|
+
import postcssDiscardComments from 'postcss-discard-comments';
|
|
2
|
+
import postcssNormalizeWhitespace from 'postcss-normalize-whitespace';
|
|
3
|
+
import postcssDiscardEmpty from 'postcss-discard-empty';
|
|
4
|
+
import cssnanoUtils from 'cssnano-utils';
|
|
6
5
|
|
|
6
|
+
const { rawCache } = cssnanoUtils;
|
|
7
7
|
/**
|
|
8
8
|
* @template {object | void} [OptionsExtends=void]
|
|
9
9
|
* @typedef {false | OptionsExtends & {exclude?: true}} SimpleOptions
|
|
@@ -58,5 +58,6 @@ function litePreset(opts = {}) {
|
|
|
58
58
|
),
|
|
59
59
|
};
|
|
60
60
|
}
|
|
61
|
+
const moduleExports = litePreset;
|
|
61
62
|
|
|
62
|
-
module.exports
|
|
63
|
+
export { moduleExports as default, moduleExports as 'module.exports' };
|
package/types/index.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
export = litePreset;
|
|
2
1
|
export type SimpleOptions<OptionsExtends extends object | void = void> = false | (OptionsExtends & {
|
|
3
2
|
exclude?: true;
|
|
4
3
|
});
|
|
@@ -17,4 +16,6 @@ export type LiteOptions = {
|
|
|
17
16
|
declare function litePreset(opts?: LiteOptions): {
|
|
18
17
|
plugins: [import('postcss').PluginCreator<any>, LiteOptions[keyof LiteOptions]][];
|
|
19
18
|
};
|
|
19
|
+
declare const moduleExports: typeof litePreset;
|
|
20
|
+
export { moduleExports as default, moduleExports as 'module.exports' };
|
|
20
21
|
//# 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":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.js"],"names":[],"mappings":"AAQG,YAAqD,aAAa,CADvC,cAAc,SAA9B,MAAM,GAAG,IAAI,GAAkB,IAAK,IACrC,KAAK,IAAG,cAAc,GAAG;IAAC,OAAO,CAAC,EAAE,IAAI,CAAA;CAAC,CAAA,CAAe;AAIlE,YAAkB,WAAW,GAC7B;IAAuE,eAAe,AAAtF,CACA,EADW,aAAa,CAAC,OAAO,0BAA0B,EAAE,OAAO,CAAC,CACpE;IAA2B,mBAAmB,AAA9C,CACA,EADW,aAAa,CACxB;IAA2B,YAAY,AAAvC,CACA,EADW,aAAa,CACxB;IAA2B,QAAQ,AAAnC,CAAoC,EAAzB,aAAa,CAAY;CAAA,CAAA;AAyBvC;;;;;GAKG;AACH,iBAAS,UAAU,CAAC,IAAI,GAHb,WAGkB,GAFhB;IAAE,OAAO,EAAE,CAAC,OAAO,SAAS,EAAE,aAAa,CAAC,GAAG,CAAC,EAAE,WAAW,CAAC,MAAM,WAAW,CAAC,CAAC,EAAE,CAAA;CAAE,CAcjG;AACD,QAAA,MAAM,aAAa,mBAAa,CAAC;AAEjC,OAAO,EAAE,aAAa,IAAI,OAAO,EAAE,aAAa,IAAI,gBAAgB,EAAE,CAAC"}
|