Comparing version 5.0.13 to 5.0.14
@@ -16,4 +16,2 @@ "use strict"; | ||
var _isResolvable = _interopRequireDefault(require("is-resolvable")); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
@@ -23,2 +21,16 @@ | ||
/* | ||
* @param {string} moduleId | ||
* @returns {boolean} | ||
*/ | ||
function isResolvable(moduleId) { | ||
try { | ||
require.resolve(moduleId); | ||
return true; | ||
} catch (e) { | ||
return false; | ||
} | ||
} | ||
/* | ||
* preset can be one of four possibilities: | ||
@@ -31,2 +43,3 @@ * preset = 'default' | ||
function resolvePreset(preset) { | ||
@@ -59,3 +72,3 @@ let fn, options; | ||
if ((0, _isResolvable.default)(fn)) { | ||
if (isResolvable(fn)) { | ||
return require(fn)(options).plugins; | ||
@@ -66,3 +79,3 @@ } | ||
if ((0, _isResolvable.default)(sugar)) { | ||
if (isResolvable(sugar)) { | ||
return require(sugar)(options).plugins; | ||
@@ -122,3 +135,3 @@ } // If all else fails, we probably have a typo in the config somewhere | ||
if (typeof pluginDef === 'string' && (0, _isResolvable.default)(pluginDef)) { | ||
if (typeof pluginDef === 'string' && isResolvable(pluginDef)) { | ||
options.preset.plugins.push([require(pluginDef), opts]); | ||
@@ -128,3 +141,3 @@ } else { | ||
} | ||
} else if (typeof plugin === 'string' && (0, _isResolvable.default)(plugin)) { | ||
} else if (typeof plugin === 'string' && isResolvable(plugin)) { | ||
options.preset.plugins.push([require(plugin), {}]); | ||
@@ -131,0 +144,0 @@ } else { |
117
package.json
{ | ||
"name": "cssnano", | ||
"version": "5.0.13", | ||
"description": "A modular minifier, built on top of the PostCSS ecosystem.", | ||
"main": "dist/index.js", | ||
"scripts": { | ||
"bundle-size": "webpack --json --config src/__tests__/_webpack.config.js | webpack-bundle-size-analyzer", | ||
"prebuild": "rimraf dist", | ||
"build": "babel src --config-file ../../babel.config.json --out-dir dist --ignore \"**/__tests__/\"", | ||
"prepare": "yarn build" | ||
}, | ||
"funding": { | ||
"type": "opencollective", | ||
"url": "https://opencollective.com/cssnano" | ||
}, | ||
"keywords": [ | ||
"css", | ||
"compress", | ||
"minify", | ||
"optimise", | ||
"optimisation", | ||
"postcss", | ||
"postcss-plugin" | ||
], | ||
"license": "MIT", | ||
"dependencies": { | ||
"cssnano-preset-default": "^5.1.9", | ||
"is-resolvable": "^1.1.0", | ||
"lilconfig": "^2.0.3", | ||
"yaml": "^1.10.2" | ||
}, | ||
"homepage": "https://github.com/cssnano/cssnano", | ||
"author": { | ||
"name": "Ben Briggs", | ||
"email": "beneb.info@gmail.com", | ||
"url": "http://beneb.info" | ||
}, | ||
"repository": "cssnano/cssnano", | ||
"files": [ | ||
"dist", | ||
"LICENSE-MIT", | ||
"quickstart.js" | ||
], | ||
"tonicExampleFilename": "quickstart.js", | ||
"bugs": { | ||
"url": "https://github.com/cssnano/cssnano/issues" | ||
}, | ||
"engines": { | ||
"node": "^10 || ^12 || >=14.0" | ||
}, | ||
"devDependencies": { | ||
"autoprefixer": "^10.3.7", | ||
"cssnano-preset-advanced": "^5.1.9", | ||
"cssnano-preset-lite": "^2.0.1", | ||
"postcss": "^8.2.15" | ||
}, | ||
"peerDependencies": { | ||
"postcss": "^8.2.15" | ||
} | ||
} | ||
"name": "cssnano", | ||
"version": "5.0.14", | ||
"description": "A modular minifier, built on top of the PostCSS ecosystem.", | ||
"main": "dist/index.js", | ||
"funding": { | ||
"type": "opencollective", | ||
"url": "https://opencollective.com/cssnano" | ||
}, | ||
"keywords": [ | ||
"css", | ||
"compress", | ||
"minify", | ||
"optimise", | ||
"optimisation", | ||
"postcss", | ||
"postcss-plugin" | ||
], | ||
"license": "MIT", | ||
"dependencies": { | ||
"cssnano-preset-default": "^5.1.9", | ||
"lilconfig": "^2.0.3", | ||
"yaml": "^1.10.2" | ||
}, | ||
"homepage": "https://github.com/cssnano/cssnano", | ||
"author": { | ||
"name": "Ben Briggs", | ||
"email": "beneb.info@gmail.com", | ||
"url": "http://beneb.info" | ||
}, | ||
"repository": "cssnano/cssnano", | ||
"files": [ | ||
"dist", | ||
"LICENSE-MIT", | ||
"quickstart.js" | ||
], | ||
"tonicExampleFilename": "quickstart.js", | ||
"bugs": { | ||
"url": "https://github.com/cssnano/cssnano/issues" | ||
}, | ||
"engines": { | ||
"node": "^10 || ^12 || >=14.0" | ||
}, | ||
"devDependencies": { | ||
"autoprefixer": "^10.3.7", | ||
"cssnano-preset-advanced": "^5.1.9", | ||
"cssnano-preset-lite": "^2.0.1", | ||
"postcss": "^8.2.15" | ||
}, | ||
"peerDependencies": { | ||
"postcss": "^8.2.15" | ||
}, | ||
"scripts": { | ||
"bundle-size": "webpack --json --config src/__tests__/_webpack.config.js | webpack-bundle-size-analyzer", | ||
"prebuild": "rimraf dist", | ||
"build": "babel src --config-file ../../babel.config.json --out-dir dist --ignore \"**/__tests__/\"" | ||
}, | ||
"readme": "# cssnano\n\nFor documentation, please see the following links:\n\n* Repository: https://github.com/cssnano/cssnano\n* Website: http://cssnano.co\n" | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
4
163
8031
6
+ Addedcaniuse-lite@1.0.30001679(transitive)
+ Addedelectron-to-chromium@1.5.55(transitive)
- Removedis-resolvable@^1.1.0
- Removedcaniuse-lite@1.0.30001677(transitive)
- Removedelectron-to-chromium@1.5.52(transitive)
- Removedis-resolvable@1.1.0(transitive)