diff options
| author | littleblack111 <littleblack11111@gmail.com> | 2026-05-18 23:10:59 +0800 |
|---|---|---|
| committer | littleblack111 <littleblack11111@gmail.com> | 2026-05-18 23:41:44 +0800 |
| commit | fc87c009806dcc98867f6b58efe29b042aa01dee (patch) | |
| tree | 8f59b3f4a5b66e9dfef2d40c8d318e258a521228 /node_modules/cssnano | |
| parent | 3336b2356ee6152d9c6ae59bd9b87ccbc0958407 (diff) | |
node: updatemain
Diffstat (limited to 'node_modules/cssnano')
| -rw-r--r-- | node_modules/cssnano/LICENSE-MIT | 22 | ||||
| -rw-r--r-- | node_modules/cssnano/README.md | 6 | ||||
| -rw-r--r-- | node_modules/cssnano/package.json | 52 | ||||
| -rw-r--r-- | node_modules/cssnano/src/index.js | 164 | ||||
| -rw-r--r-- | node_modules/cssnano/types/index.d.ts | 17 | ||||
| -rw-r--r-- | node_modules/cssnano/types/index.d.ts.map | 1 |
6 files changed, 0 insertions, 262 deletions
diff --git a/node_modules/cssnano/LICENSE-MIT b/node_modules/cssnano/LICENSE-MIT deleted file mode 100644 index fd0e863a..00000000 --- a/node_modules/cssnano/LICENSE-MIT +++ /dev/null @@ -1,22 +0,0 @@ -Copyright (c) Ben Briggs <beneb.info@gmail.com> (http://beneb.info) - -Permission is hereby granted, free of charge, to any person -obtaining a copy of this software and associated documentation -files (the "Software"), to deal in the Software without -restriction, including without limitation the rights to use, -copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the -Software is furnished to do so, subject to the following -conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/cssnano/README.md b/node_modules/cssnano/README.md deleted file mode 100644 index 0f110530..00000000 --- a/node_modules/cssnano/README.md +++ /dev/null @@ -1,6 +0,0 @@ -# cssnano - -For documentation, please see the following links: - -* Repository: https://github.com/cssnano/cssnano -* Website: http://cssnano.github.io/cssnano diff --git a/node_modules/cssnano/package.json b/node_modules/cssnano/package.json deleted file mode 100644 index 00bbacd0..00000000 --- a/node_modules/cssnano/package.json +++ /dev/null @@ -1,52 +0,0 @@ -{ - "name": "cssnano", - "version": "6.1.2", - "description": "A modular minifier, built on top of the PostCSS ecosystem.", - "main": "src/index.js", - "types": "types/index.d.ts", - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/cssnano" - }, - "keywords": [ - "css", - "compress", - "minify", - "optimise", - "optimisation", - "postcss", - "postcss-plugin" - ], - "license": "MIT", - "dependencies": { - "lilconfig": "^3.1.1", - "cssnano-preset-default": "^6.1.2" - }, - "homepage": "https://github.com/cssnano/cssnano", - "author": { - "name": "Ben Briggs", - "email": "beneb.info@gmail.com", - "url": "http://beneb.info" - }, - "repository": "cssnano/cssnano", - "files": [ - "src", - "LICENSE-MIT", - "types" - ], - "bugs": { - "url": "https://github.com/cssnano/cssnano/issues" - }, - "engines": { - "node": "^14 || ^16 || >=18.0" - }, - "devDependencies": { - "autoprefixer": "^10.4.19", - "postcss": "^8.4.38", - "cssnano-preset-advanced": "^6.1.2", - "cssnano-preset-lite": "^3.1.0" - }, - "peerDependencies": { - "postcss": "^8.4.31" - } -}
\ No newline at end of file diff --git a/node_modules/cssnano/src/index.js b/node_modules/cssnano/src/index.js deleted file mode 100644 index 20c38975..00000000 --- a/node_modules/cssnano/src/index.js +++ /dev/null @@ -1,164 +0,0 @@ -'use strict'; -const path = require('path'); -/** @type {any} */ -const postcss = require('postcss'); -const { lilconfigSync } = require('lilconfig'); - -const cssnano = 'cssnano'; - -/** @typedef {{preset?: any, plugins?: any[], configFile?: string}} Options */ -/** - * @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: - * preset = 'default' - * preset = ['default', {}] - * preset = function <- to be invoked - * preset = {plugins: []} <- already invoked function - * - * @param {any} preset - * @return {[import('postcss').PluginCreator<any>, boolean | Record<string, any> | undefined][]}} - */ -function resolvePreset(preset) { - let fn, options; - - if (Array.isArray(preset)) { - fn = preset[0]; - options = preset[1]; - } else { - fn = preset; - options = {}; - } - - // For JS setups where we invoked the preset already - if (fn.plugins) { - return fn.plugins; - } - - // Provide an alias for the default preset, as it is built-in. - if (fn === 'default') { - return require('cssnano-preset-default')(options).plugins; - } - - // For non-JS setups; we'll need to invoke the preset ourselves. - if (typeof fn === 'function') { - return fn(options).plugins; - } - - // Try loading a preset from node_modules - if (isResolvable(fn)) { - return require(fn)(options).plugins; - } - - const sugar = `cssnano-preset-${fn}`; - - // Try loading a preset from node_modules (sugar) - if (isResolvable(sugar)) { - return require(sugar)(options).plugins; - } - - // If all else fails, we probably have a typo in the config somewhere - throw new Error( - `Cannot load preset "${fn}". Please check your configuration for errors and try again.` - ); -} - -/** - * cssnano will look for configuration firstly as options passed - * directly to it, and failing this it will use lilconfig to - * load an external file. - - * @param {Options} options - */ -function resolveConfig(options) { - if (options.preset) { - return resolvePreset(options.preset); - } - - /** @type {string | undefined} */ - let searchPath = process.cwd(); - let configPath = undefined; - - if (options.configFile) { - searchPath = undefined; - configPath = path.resolve(process.cwd(), options.configFile); - } - - const configExplorer = lilconfigSync(cssnano, { - searchPlaces: [ - 'package.json', - '.cssnanorc', - '.cssnanorc.json', - '.cssnanorc.js', - 'cssnano.config.js', - ], - }); - const config = configPath - ? configExplorer.load(configPath) - : configExplorer.search(searchPath); - - if (config === null) { - return resolvePreset('default'); - } - - return resolvePreset(config.config.preset || config.config); -} - -/** - * @type {import('postcss').PluginCreator<Options>} - * @param {Options=} options - * @return {import('postcss').Processor} - */ -function cssnanoPlugin(options = {}) { - if (Array.isArray(options.plugins)) { - if (!options.preset || !options.preset.plugins) { - options.preset = { plugins: [] }; - } - - options.plugins.forEach((plugin) => { - if (Array.isArray(plugin)) { - const [pluginDef, opts = {}] = plugin; - if (typeof pluginDef === 'string' && isResolvable(pluginDef)) { - options.preset.plugins.push([require(pluginDef), opts]); - } else { - options.preset.plugins.push([pluginDef, opts]); - } - } else if (typeof plugin === 'string' && isResolvable(plugin)) { - options.preset.plugins.push([require(plugin), {}]); - } else { - options.preset.plugins.push([plugin, {}]); - } - }); - } - const plugins = []; - const nanoPlugins = resolveConfig(options); - for (const nanoPlugin of nanoPlugins) { - if (Array.isArray(nanoPlugin)) { - const [processor, opts] = nanoPlugin; - if ( - typeof opts === 'undefined' || - (typeof opts === 'object' && !opts.exclude) || - (typeof opts === 'boolean' && opts === true) - ) { - plugins.push(processor(opts)); - } - } else { - plugins.push(nanoPlugin); - } - } - return postcss(plugins); -} - -cssnanoPlugin.postcss = true; -module.exports = cssnanoPlugin; diff --git a/node_modules/cssnano/types/index.d.ts b/node_modules/cssnano/types/index.d.ts deleted file mode 100644 index 1a2de054..00000000 --- a/node_modules/cssnano/types/index.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -export = cssnanoPlugin; -/** - * @type {import('postcss').PluginCreator<Options>} - * @param {Options=} options - * @return {import('postcss').Processor} - */ -declare function cssnanoPlugin(options?: Options | undefined): import('postcss').Processor; -declare namespace cssnanoPlugin { - export { postcss, Options }; -} -type Options = { - preset?: any; - plugins?: any[]; - configFile?: string; -}; -declare var postcss: true; -//# sourceMappingURL=index.d.ts.map
\ No newline at end of file diff --git a/node_modules/cssnano/types/index.d.ts.map b/node_modules/cssnano/types/index.d.ts.map deleted file mode 100644 index fb90da91..00000000 --- a/node_modules/cssnano/types/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.js"],"names":[],"mappings":";AAqHA;;;;GAIG;AACH,yCAHW,OAAO,eACN,OAAO,SAAS,EAAE,SAAS,CAwCtC;;;;eAxJa;IAAC,MAAM,CAAC,EAAE,GAAG,CAAC;IAAC,OAAO,CAAC,EAAE,GAAG,EAAE,CAAC;IAAC,UAAU,CAAC,EAAE,MAAM,CAAA;CAAC"}
\ No newline at end of file |
