cssnano 5.0.6 → 5.0.7

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.
Files changed (2) hide show
  1. package/dist/index.js +11 -3
  2. package/package.json +5 -4
package/dist/index.js CHANGED
@@ -9,7 +9,9 @@ var _path = _interopRequireDefault(require("path"));
9
9
 
10
10
  var _postcss = _interopRequireDefault(require("postcss"));
11
11
 
12
- var _cosmiconfig = require("cosmiconfig");
12
+ var _yaml = _interopRequireDefault(require("yaml"));
13
+
14
+ var _lilconfig = require("lilconfig");
13
15
 
14
16
  var _isResolvable = _interopRequireDefault(require("is-resolvable"));
15
17
 
@@ -66,7 +68,7 @@ function resolvePreset(preset) {
66
68
  }
67
69
  /*
68
70
  * cssnano will look for configuration firstly as options passed
69
- * directly to it, and failing this it will use cosmiconfig to
71
+ * directly to it, and failing this it will use lilconfig to
70
72
  * load an external file.
71
73
  */
72
74
 
@@ -84,7 +86,13 @@ function resolveConfig(options) {
84
86
  configPath = _path.default.resolve(process.cwd(), options.configFile);
85
87
  }
86
88
 
87
- const configExplorer = (0, _cosmiconfig.cosmiconfigSync)(cssnano);
89
+ const configExplorer = (0, _lilconfig.lilconfigSync)(cssnano, {
90
+ searchPlaces: ['package.json', '.cssnanorc', '.cssnanorc.json', '.cssnanorc.yaml', '.cssnanorc.yml', '.cssnanorc.js', 'cssnano.config.js'],
91
+ loaders: {
92
+ '.yaml': (filepath, content) => _yaml.default.parse(content),
93
+ '.yml': (filepath, content) => _yaml.default.parse(content)
94
+ }
95
+ });
88
96
  const config = configPath ? configExplorer.load(configPath) : configExplorer.search(searchPath);
89
97
 
90
98
  if (config === null) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cssnano",
3
- "version": "5.0.6",
3
+ "version": "5.0.7",
4
4
  "description": "A modular minifier, built on top of the PostCSS ecosystem.",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
@@ -24,9 +24,10 @@
24
24
  ],
25
25
  "license": "MIT",
26
26
  "dependencies": {
27
- "cosmiconfig": "^7.0.0",
28
27
  "cssnano-preset-default": "^5.1.3",
29
- "is-resolvable": "^1.1.0"
28
+ "is-resolvable": "^1.1.0",
29
+ "lilconfig": "^2.0.3",
30
+ "yaml": "^1.10.2"
30
31
  },
31
32
  "homepage": "https://github.com/cssnano/cssnano",
32
33
  "author": {
@@ -54,5 +55,5 @@
54
55
  "peerDependencies": {
55
56
  "postcss": "^8.2.15"
56
57
  },
57
- "gitHead": "39b4cc089e8825d308df1fa8a7313d38d8f1f2f7"
58
+ "gitHead": "fdb6a8fb922bcb3e857f1fdc341488736af37013"
58
59
  }