css-minimizer-webpack-plugin
Advanced tools
+13
-14
@@ -36,2 +36,5 @@ "use strict"; | ||
| // eslint-disable-next-line jsdoc/reject-any-type | ||
| /** @typedef {any} EXPECTED_ANY */ | ||
| /** | ||
@@ -66,4 +69,4 @@ * @typedef {Record<string, unknown>} CssNanoOptions | ||
| * @property {RawSourceMap=} map Source map | ||
| * @property {Array<Error | ErrorObject| string>=} errors Errors | ||
| * @property {Array<Warning | WarningObject | string>=} warnings Warnings | ||
| * @property {(Error | ErrorObject | string)[]=} errors Errors | ||
| * @property {(Warning | WarningObject | string)[]=} warnings Warnings | ||
| */ | ||
@@ -86,3 +89,3 @@ | ||
| * @template T | ||
| * @typedef {T extends any[] ? { [P in keyof T]?: InferDefaultType<T[P]> } : InferDefaultType<T>} MinimizerOptions | ||
| * @typedef {T extends EXPECTED_ANY[] ? { [P in keyof T]?: InferDefaultType<T[P]> } : InferDefaultType<T>} MinimizerOptions | ||
| */ | ||
@@ -106,3 +109,3 @@ | ||
| * @template T | ||
| * @typedef {T extends any[] ? { [P in keyof T]: BasicMinimizerImplementation<T[P]> & MinimizeFunctionHelpers; } : BasicMinimizerImplementation<T> & MinimizeFunctionHelpers} MinimizerImplementation | ||
| * @typedef {T extends EXPECTED_ANY[] ? { [P in keyof T]: BasicMinimizerImplementation<T[P]> & MinimizeFunctionHelpers } : BasicMinimizerImplementation<T> & MinimizeFunctionHelpers} MinimizerImplementation | ||
| */ | ||
@@ -121,5 +124,5 @@ | ||
| * @typedef InternalResult | ||
| * @property {Array<{ code: string, map: RawSourceMap | undefined }>} outputs - Outputs | ||
| * @property {Array<Warning | WarningObject | string>} warnings - Warnings | ||
| * @property {Array<Error | ErrorObject | string>} errors - Errors | ||
| * @property {{ code: string, map: RawSourceMap | undefined }[]} outputs - Outputs | ||
| * @property {(Warning | WarningObject | string)[]} warnings - Warnings | ||
| * @property {(Error | ErrorObject | string)[]} errors - Errors | ||
| */ | ||
@@ -149,3 +152,3 @@ | ||
| /** | ||
| * @typedef {ProcessOptions | { from?: string, to?: string, parser?: string | Syntax | Parser, stringifier?: string | Syntax | Stringifier, syntax?: string | Syntax } } ProcessOptionsExtender | ||
| * @typedef {ProcessOptions | { from?: string, to?: string, parser?: string | Syntax | Parser, stringifier?: string | Syntax | Stringifier, syntax?: string | Syntax }} ProcessOptionsExtender | ||
| */ | ||
@@ -332,7 +335,3 @@ | ||
| const cpus = | ||
| // eslint-disable-next-line n/no-unsupported-features/node-builtins | ||
| typeof os.availableParallelism === "function" ? | ||
| // eslint-disable-next-line n/no-unsupported-features/node-builtins | ||
| { | ||
| const cpus = typeof os.availableParallelism === "function" ? { | ||
| length: os.availableParallelism() | ||
@@ -360,3 +359,3 @@ } : os.cpus() || { | ||
| * @param {Record<string, import("webpack").sources.Source>} assets Assets | ||
| * @param {{availableNumberOfCores: number}} optimizeOptions Optimize options | ||
| * @param {{ availableNumberOfCores: number }} optimizeOptions Optimize options | ||
| * @returns {Promise<void>} Promise | ||
@@ -363,0 +362,0 @@ */ |
+20
-17
@@ -7,2 +7,3 @@ "use strict"; | ||
| /** @typedef {import("./index.js").CustomOptions} CustomOptions */ | ||
| /** @typedef {import("./index.js").EXPECTED_ANY} EXPECTED_ANY */ | ||
| /** @typedef {import("postcss").ProcessOptions} ProcessOptions */ | ||
@@ -86,3 +87,3 @@ /** @typedef {import("postcss").Postcss} Postcss */ | ||
| } | ||
| if (/** @type {Error & {code: string}} */ | ||
| if (/** @type {Error & { code: string }} */ | ||
| err.code === "ERR_REQUIRE_ESM" && importESM) { | ||
@@ -105,3 +106,5 @@ exports = await importESM(module); | ||
| } catch (error) { | ||
| throw new Error(`Loading PostCSS "${postcssOptions.parser}" parser failed: ${/** @type {Error} */error.message}\n\n(@${name})`); | ||
| throw new Error(`Loading PostCSS "${postcssOptions.parser}" parser failed: ${ /** @type {Error} */error.message}\n\n(@${name})`, { | ||
| cause: error | ||
| }); | ||
| } | ||
@@ -113,3 +116,5 @@ } | ||
| } catch (error) { | ||
| throw new Error(`Loading PostCSS "${postcssOptions.stringifier}" stringifier failed: ${/** @type {Error} */error.message}\n\n(@${name})`); | ||
| throw new Error(`Loading PostCSS "${postcssOptions.stringifier}" stringifier failed: ${ /** @type {Error} */error.message}\n\n(@${name})`, { | ||
| cause: error | ||
| }); | ||
| } | ||
@@ -121,3 +126,5 @@ } | ||
| } catch (error) { | ||
| throw new Error(`Loading PostCSS "${postcssOptions.syntax}" syntax failed: ${/** @type {Error} */error.message}\n\n(@${name})`); | ||
| throw new Error(`Loading PostCSS "${postcssOptions.syntax}" syntax failed: ${ /** @type {Error} */error.message}\n\n(@${name})`, { | ||
| cause: error | ||
| }); | ||
| } | ||
@@ -190,4 +197,3 @@ } | ||
| const generatedSourceMap = result.sourceMap ? (/** @type {RawSourceMap} */ | ||
| // eslint-disable-next-line jsdoc/no-restricted-syntax | ||
| /** @type {any} */result.sourceMap.toJSON()) : undefined; | ||
| /** @type {EXPECTED_ANY} */result.sourceMap.toJSON()) : undefined; | ||
@@ -270,6 +276,6 @@ // workaround for source maps on windows | ||
| const [[filename, code]] = Object.entries(input); | ||
| // eslint-disable-next-line jsdoc/no-restricted-syntax | ||
| /** | ||
| * @param {Partial<import("@parcel/css").TransformOptions<any>>=} parcelCssOptions Parcel CSS options | ||
| * @returns {import("@parcel/css").TransformOptions<any>} Built Parcel CSS options | ||
| * @param {Partial<import("@parcel/css").TransformOptions<EXPECTED_ANY>>=} parcelCssOptions Parcel CSS options | ||
| * @returns {import("@parcel/css").TransformOptions<EXPECTED_ANY>} Built Parcel CSS options | ||
| */ | ||
@@ -311,6 +317,6 @@ const buildParcelCssOptions = (parcelCssOptions = {}) => ( | ||
| const [[filename, code]] = Object.entries(input); | ||
| // eslint-disable-next-line jsdoc/no-restricted-syntax | ||
| /** | ||
| * @param {Partial<import("lightningcss").TransformOptions<any>>=} lightningCssOptions Lightning CSS options | ||
| * @returns {import("lightningcss").TransformOptions<any>} Built Lightning CSS options | ||
| * @param {Partial<import("lightningcss").TransformOptions<EXPECTED_ANY>>=} lightningCssOptions Lightning CSS options | ||
| * @returns {import("lightningcss").TransformOptions<EXPECTED_ANY>} Built Lightning CSS options | ||
| */ | ||
@@ -378,8 +384,5 @@ const buildLightningCssOptions = (lightningCssOptions = {}) => ( | ||
| // eslint-disable-next-line jsdoc/no-restricted-syntax | ||
| /** @type {any} */ | ||
| /** @type {EXPECTED_ANY} */ | ||
| error.span = diagnostic.span; | ||
| // eslint-disable-next-line jsdoc/no-restricted-syntax | ||
| /** @type {any} */ | ||
| /** @type {EXPECTED_ANY} */ | ||
| error.level = diagnostic.level; | ||
@@ -386,0 +389,0 @@ return error; |
+10
-21
| { | ||
| "name": "css-minimizer-webpack-plugin", | ||
| "version": "7.0.4", | ||
| "version": "8.0.0", | ||
| "description": "CSS minimizer (minifier) plugin for Webpack", | ||
@@ -67,3 +67,3 @@ "keywords": [ | ||
| "schema-utils": "^4.2.0", | ||
| "serialize-javascript": "^6.0.2" | ||
| "serialize-javascript": "^7.0.3" | ||
| }, | ||
@@ -74,8 +74,5 @@ "devDependencies": { | ||
| "@babel/preset-env": "^7.25.3", | ||
| "@commitlint/cli": "^19.3.0", | ||
| "@commitlint/config-conventional": "^19.2.2", | ||
| "@eslint/js": "^9.32.0", | ||
| "@eslint/markdown": "^7.0.0", | ||
| "@commitlint/cli": "^20.4.2", | ||
| "@commitlint/config-conventional": "^20.4.2", | ||
| "@parcel/css": "^1.8.3", | ||
| "@stylistic/eslint-plugin": "^5.2.2", | ||
| "@swc/css": "^0.0.28", | ||
@@ -88,5 +85,5 @@ "@types/clean-css": "^4.2.11", | ||
| "clean-css": "^5.3.3", | ||
| "copy-webpack-plugin": "^13.0.0", | ||
| "copy-webpack-plugin": "^14.0.0", | ||
| "cross-env": "^7.0.3", | ||
| "cspell": "^8.13.1", | ||
| "cspell": "^9.7.0", | ||
| "css-loader": "^6.10.0", | ||
@@ -96,18 +93,10 @@ "cssnano-preset-simple": "^4.0.0", | ||
| "del": "^6.1.0", | ||
| "del-cli": "^5.1.0", | ||
| "esbuild": "^0.25.0", | ||
| "del-cli": "^7.0.0", | ||
| "esbuild": "^0.27.3", | ||
| "eslint": "^9.30.1", | ||
| "eslint-config-prettier": "^10.1.5", | ||
| "eslint-config-webpack": "^4.4.1", | ||
| "eslint-plugin-import": "^2.32.0", | ||
| "eslint-plugin-jest": "^29.0.1", | ||
| "eslint-plugin-jsdoc": "^52.0.0", | ||
| "eslint-plugin-n": "^17.21.0", | ||
| "eslint-plugin-prettier": "^5.5.3", | ||
| "eslint-plugin-unicorn": "^60.0.0", | ||
| "globals": "^16.3.0", | ||
| "husky": "^9.1.4", | ||
| "jest": "^30.0.5", | ||
| "lightningcss": "^1.25.1", | ||
| "lint-staged": "^15.2.8", | ||
| "lint-staged": "^16.3.1", | ||
| "memfs": "^4.11.1", | ||
@@ -148,4 +137,4 @@ "mini-css-extract-plugin": "^2.9.0", | ||
| "engines": { | ||
| "node": ">= 18.12.0" | ||
| "node": ">= 20.9.0" | ||
| } | ||
| } |
+1
-1
@@ -319,3 +319,3 @@ <div align="center"> | ||
| Cssnano optimisations [options](https://cssnano.co/docs/what-are-optimisations/). | ||
| Cssnano optimisations [options](https://cssnano.github.io/cssnano/docs/what-are-optimisations/#what-are-optimisations). | ||
@@ -322,0 +322,0 @@ #### `Object` |
+11
-9
@@ -62,3 +62,3 @@ export = CssMinimizerPlugin; | ||
| * @param {Record<string, import("webpack").sources.Source>} assets Assets | ||
| * @param {{availableNumberOfCores: number}} optimizeOptions Optimize options | ||
| * @param {{ availableNumberOfCores: number }} optimizeOptions Optimize options | ||
| * @returns {Promise<void>} Promise | ||
@@ -94,2 +94,3 @@ */ | ||
| TraceMap, | ||
| EXPECTED_ANY, | ||
| CssNanoOptions, | ||
@@ -144,2 +145,3 @@ Warning, | ||
| type TraceMap = import("@jridgewell/trace-mapping").TraceMap; | ||
| type EXPECTED_ANY = any; | ||
| type CssNanoOptions = Record<string, unknown>; | ||
@@ -205,7 +207,7 @@ type Warning = | ||
| */ | ||
| errors?: Array<Error | ErrorObject | string> | undefined; | ||
| errors?: (Error | ErrorObject | string)[] | undefined; | ||
| /** | ||
| * Warnings | ||
| */ | ||
| warnings?: Array<Warning | WarningObject | string> | undefined; | ||
| warnings?: (Warning | WarningObject | string)[] | undefined; | ||
| }; | ||
@@ -219,3 +221,3 @@ type Input = { | ||
| type InferDefaultType<T> = T extends infer U ? U : CustomOptions; | ||
| type MinimizerOptions<T> = T extends any[] | ||
| type MinimizerOptions<T> = T extends EXPECTED_ANY[] | ||
| ? { [P in keyof T]?: InferDefaultType<T[P]> } | ||
@@ -234,3 +236,3 @@ : InferDefaultType<T>; | ||
| }; | ||
| type MinimizerImplementation<T> = T extends any[] | ||
| type MinimizerImplementation<T> = T extends EXPECTED_ANY[] | ||
| ? { | ||
@@ -266,14 +268,14 @@ [P in keyof T]: BasicMinimizerImplementation<T[P]> & | ||
| */ | ||
| outputs: Array<{ | ||
| outputs: { | ||
| code: string; | ||
| map: RawSourceMap | undefined; | ||
| }>; | ||
| }[]; | ||
| /** | ||
| * - Warnings | ||
| */ | ||
| warnings: Array<Warning | WarningObject | string>; | ||
| warnings: (Warning | WarningObject | string)[]; | ||
| /** | ||
| * - Errors | ||
| */ | ||
| errors: Array<Error | ErrorObject | string>; | ||
| errors: (Error | ErrorObject | string)[]; | ||
| }; | ||
@@ -280,0 +282,0 @@ type Parallel = undefined | boolean | number; |
+1
-0
@@ -6,2 +6,3 @@ export type Task<T> = () => Promise<T>; | ||
| export type CustomOptions = import("./index.js").CustomOptions; | ||
| export type EXPECTED_ANY = import("./index.js").EXPECTED_ANY; | ||
| export type ProcessOptions = import("postcss").ProcessOptions; | ||
@@ -8,0 +9,0 @@ export type Postcss = import("postcss").Postcss; |
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
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
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
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
38
-22.45%1601
0.19%74774
-0.51%+ Added
+ Added
- Removed
- Removed
- Removed
- Removed
Updated