File tree Expand file tree Collapse file tree 3 files changed +10
-6
lines changed Expand file tree Collapse file tree 3 files changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -163,7 +163,7 @@ class CssMinimizerPlugin {
163
163
minify = /** @type {MinimizerImplementation<InferDefaultType<T>> } */
164
164
( cssnanoMinify ) ,
165
165
minimizerOptions = /** @type {MinimizerOptions<InferDefaultType<T>> } */
166
- ( { preset : "default" } ) ,
166
+ ( { } ) ,
167
167
test = / \. c s s ( \? .* ) ? $ / i,
168
168
warningsFilter = ( ) => true ,
169
169
parallel = true ,
@@ -499,14 +499,14 @@ class CssMinimizerPlugin {
499
499
input = sourceFromInputSource ;
500
500
501
501
if ( map ) {
502
- inputSourceMap = /** @type {RawSourceMap } */ ( map ) ;
503
-
504
502
if ( ! CssMinimizerPlugin . isSourceMap ( map ) ) {
505
503
compilation . warnings . push (
506
504
/** @type {WebpackError } */ (
507
505
new Error ( `${ name } contains invalid source map` )
508
506
)
509
507
) ;
508
+ } else {
509
+ inputSourceMap = /** @type {RawSourceMap } */ ( map ) ;
510
510
}
511
511
}
512
512
Original file line number Diff line number Diff line change @@ -75,7 +75,11 @@ function throttleAll(limit, tasks) {
75
75
* @param {CustomOptions } minimizerOptions
76
76
* @return {Promise<MinimizedResult> }
77
77
*/
78
- async function cssnanoMinify ( input , sourceMap , minimizerOptions ) {
78
+ async function cssnanoMinify (
79
+ input ,
80
+ sourceMap ,
81
+ minimizerOptions = { preset : "default" }
82
+ ) {
79
83
/**
80
84
* @template T
81
85
* @param {string } module
Original file line number Diff line number Diff line change @@ -272,9 +272,9 @@ exports[`"minify" option should work with "CssMinimizerPlugin.esbuildMinify" min
272
272
exports [` "minify" option should work with "CssMinimizerPlugin.esbuildMinify" minifier and emit warnings: warning 1` ] = `
273
273
Array [
274
274
"Warning: foo.css from Css Minimizer plugin
275
- Expected identifier but found whitespace",
275
+ Expected identifier but found whitespace webpack://./wrong-calc.css:1:0 ",
276
276
"Warning: foo.css from Css Minimizer plugin
277
- Unexpected \\ "calc(\\ "",
277
+ Unexpected \\ "calc(\\ " webpack://./wrong-calc.css:1:0 ",
278
278
]
279
279
` ;
280
280
You can’t perform that action at this time.
0 commit comments