Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
chore: fix lint
  • Loading branch information
ersachin3112 committed Jul 24, 2025
commit 76f18265ca0fef73e476d2cdd6265b0c41109d34
31 changes: 1 addition & 30 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@
"dependencies": {
"@jridgewell/trace-mapping": "^0.3.25",
"cssnano": "^7.0.4",
"jest-worker": "^30.0.5",
"postcss": "^8.4.40",
"schema-utils": "^4.2.0",
"serialize-javascript": "^6.0.2"
Expand Down
11 changes: 9 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,9 @@ class CssMinimizerPlugin {
});

const {
minify = /** @type {BasicMinimizerImplementation<T>} */ (cssnanoMinify),
minify: minifyOption = /** @type {BasicMinimizerImplementation<T>} */ (
cssnanoMinify
),
minimizerOptions = /** @type {MinimizerOptions<T>} */ ({}),
test = /\.css(\?.*)?$/i,
warningsFilter = () => true,
Expand All @@ -189,6 +191,9 @@ class CssMinimizerPlugin {
exclude,
} = options || {};

// Avoid shadowing by assigning to a new variable
const defaultMinify = minifyOption;

/**
* @private
* @type {InternalPluginOptions<T>}
Expand All @@ -200,7 +205,9 @@ class CssMinimizerPlugin {
include,
exclude,
minimizer: {
implementation: /** @type {MinimizerImplementation<T>} */ (minify),
implementation: /** @type {MinimizerImplementation<T>} */ (
defaultMinify
),
options: minimizerOptions,
},
};
Expand Down
Loading