Skip to content

Commit 50b0c97

Browse files
chore: update deps
1 parent 00b3763 commit 50b0c97

File tree

6 files changed

+22
-112
lines changed

6 files changed

+22
-112
lines changed

package-lock.json

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@
112112
"npm-run-all": "^4.1.5",
113113
"prettier": "^3.3.3",
114114
"sass": "^1.77.8",
115-
"sass-loader": "^14.2.1",
115+
"sass-loader": "^16.0.5",
116116
"standard-version": "^9.5.0",
117117
"sugarss": "^4.0.1",
118118
"typescript": "^5.5.4",

src/index.js

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -180,9 +180,7 @@ class CssMinimizerPlugin {
180180
});
181181

182182
const {
183-
minify: minifyOption = /** @type {BasicMinimizerImplementation<T>} */ (
184-
cssnanoMinify
185-
),
183+
minify = /** @type {BasicMinimizerImplementation<T>} */ (cssnanoMinify),
186184
minimizerOptions = /** @type {MinimizerOptions<T>} */ ({}),
187185
test = /\.css(\?.*)?$/i,
188186
warningsFilter = () => true,
@@ -191,9 +189,6 @@ class CssMinimizerPlugin {
191189
exclude,
192190
} = options || {};
193191

194-
// Avoid shadowing by assigning to a new variable
195-
const defaultMinify = minifyOption;
196-
197192
/**
198193
* @private
199194
* @type {InternalPluginOptions<T>}
@@ -205,9 +200,7 @@ class CssMinimizerPlugin {
205200
include,
206201
exclude,
207202
minimizer: {
208-
implementation: /** @type {MinimizerImplementation<T>} */ (
209-
defaultMinify
210-
),
203+
implementation: /** @type {MinimizerImplementation<T>} */ (minify),
211204
options: minimizerOptions,
212205
},
213206
};

test/__snapshots__/minify-option.test.js.snap

Lines changed: 1 addition & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Jest Snapshot v1, https://goo.gl/fbAQLP
1+
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing
22

33
exports[`"minify" option should work and allow to return errors and warnings from custom function: assets 1`] = `
44
{
@@ -15,8 +15,6 @@ Error 1",
1515
"Error: foo.css from Css Minimizer plugin
1616
Error: Error 2",
1717
"ModuleWarning: Module Warning (from ../../node_modules/sass-loader/dist/cjs.js):
18-
Deprecation The legacy JS API is deprecated and will be removed in Dart Sass 2.0.0.",
19-
"ModuleWarning: Module Warning (from ../../node_modules/sass-loader/dist/cjs.js):
2018
Deprecation Warning on line 0, column 8 of file:///test/fixtures/sourcemap/foo.scss:0:8:",
2119
"Warning: foo.css from Css Minimizer plugin
2220
Warning 1",
@@ -57,8 +55,6 @@ exports[`"minify" option should work if minify is array && minimizerOptions is a
5755
exports[`"minify" option should work if minify is array && minimizerOptions is array: warning 1`] = `
5856
[
5957
"ModuleWarning: Module Warning (from ../../node_modules/sass-loader/dist/cjs.js):
60-
Deprecation The legacy JS API is deprecated and will be removed in Dart Sass 2.0.0.",
61-
"ModuleWarning: Module Warning (from ../../node_modules/sass-loader/dist/cjs.js):
6258
Deprecation Warning on line 0, column 8 of file:///test/fixtures/sourcemap/foo.scss:0:8:",
6359
]
6460
`;
@@ -94,8 +90,6 @@ exports[`"minify" option should work if minify is array && minimizerOptions is o
9490
exports[`"minify" option should work if minify is array && minimizerOptions is object: warning 1`] = `
9591
[
9692
"ModuleWarning: Module Warning (from ../../node_modules/sass-loader/dist/cjs.js):
97-
Deprecation The legacy JS API is deprecated and will be removed in Dart Sass 2.0.0.",
98-
"ModuleWarning: Module Warning (from ../../node_modules/sass-loader/dist/cjs.js):
9993
Deprecation Warning on line 0, column 8 of file:///test/fixtures/sourcemap/foo.scss:0:8:",
10094
]
10195
`;
@@ -126,8 +120,6 @@ Error: minimizer function doesn't return the 'code' property or result is not a
126120
exports[`"minify" option should work throw an error if minimizer function doesn't return #2: warning 1`] = `
127121
[
128122
"ModuleWarning: Module Warning (from ../../node_modules/sass-loader/dist/cjs.js):
129-
Deprecation The legacy JS API is deprecated and will be removed in Dart Sass 2.0.0.",
130-
"ModuleWarning: Module Warning (from ../../node_modules/sass-loader/dist/cjs.js):
131123
Deprecation Warning on line 0, column 8 of file:///test/fixtures/sourcemap/foo.scss:0:8:",
132124
]
133125
`;
@@ -158,8 +150,6 @@ Error: minimizer function doesn't return the 'code' property or result is not a
158150
exports[`"minify" option should work throw an error if minimizer function doesn't return: warning 1`] = `
159151
[
160152
"ModuleWarning: Module Warning (from ../../node_modules/sass-loader/dist/cjs.js):
161-
Deprecation The legacy JS API is deprecated and will be removed in Dart Sass 2.0.0.",
162-
"ModuleWarning: Module Warning (from ../../node_modules/sass-loader/dist/cjs.js):
163153
Deprecation Warning on line 0, column 8 of file:///test/fixtures/sourcemap/foo.scss:0:8:",
164154
]
165155
`;
@@ -177,8 +167,6 @@ exports[`"minify" option should work with "CssMinimizerPlugin.cleanCssMinify" mi
177167
exports[`"minify" option should work with "CssMinimizerPlugin.cleanCssMinify" minifier and generate source maps #2: warning 1`] = `
178168
[
179169
"ModuleWarning: Module Warning (from ../../node_modules/sass-loader/dist/cjs.js):
180-
Deprecation The legacy JS API is deprecated and will be removed in Dart Sass 2.0.0.",
181-
"ModuleWarning: Module Warning (from ../../node_modules/sass-loader/dist/cjs.js):
182170
Deprecation Warning on line 0, column 8 of file:///test/fixtures/sourcemap/foo.scss:0:8:",
183171
]
184172
`;
@@ -218,8 +206,6 @@ exports[`"minify" option should work with "CssMinimizerPlugin.cssnanoMinify" min
218206
exports[`"minify" option should work with "CssMinimizerPlugin.cssnanoMinify" minifier and generate source maps #2: warning 1`] = `
219207
[
220208
"ModuleWarning: Module Warning (from ../../node_modules/sass-loader/dist/cjs.js):
221-
Deprecation The legacy JS API is deprecated and will be removed in Dart Sass 2.0.0.",
222-
"ModuleWarning: Module Warning (from ../../node_modules/sass-loader/dist/cjs.js):
223209
Deprecation Warning on line 0, column 8 of file:///test/fixtures/sourcemap/foo.scss:0:8:",
224210
]
225211
`;
@@ -237,8 +223,6 @@ exports[`"minify" option should work with "CssMinimizerPlugin.cssnanoMinify" min
237223
exports[`"minify" option should work with "CssMinimizerPlugin.cssnanoMinify" minifier and generate source maps: warning 1`] = `
238224
[
239225
"ModuleWarning: Module Warning (from ../../node_modules/sass-loader/dist/cjs.js):
240-
Deprecation The legacy JS API is deprecated and will be removed in Dart Sass 2.0.0.",
241-
"ModuleWarning: Module Warning (from ../../node_modules/sass-loader/dist/cjs.js):
242226
Deprecation Warning on line 0, column 8 of file:///test/fixtures/sourcemap/foo.scss:0:8:",
243227
]
244228
`;
@@ -258,8 +242,6 @@ exports[`"minify" option should work with "CssMinimizerPlugin.cssnanoMinify" min
258242
exports[`"minify" option should work with "CssMinimizerPlugin.cssnanoMinify" minifier: warning 1`] = `
259243
[
260244
"ModuleWarning: Module Warning (from ../../node_modules/sass-loader/dist/cjs.js):
261-
Deprecation The legacy JS API is deprecated and will be removed in Dart Sass 2.0.0.",
262-
"ModuleWarning: Module Warning (from ../../node_modules/sass-loader/dist/cjs.js):
263245
Deprecation Warning on line 0, column 8 of file:///test/fixtures/sourcemap/foo.scss:0:8:",
264246
]
265247
`;
@@ -299,8 +281,6 @@ exports[`"minify" option should work with "CssMinimizerPlugin.cssoMinify" minifi
299281
exports[`"minify" option should work with "CssMinimizerPlugin.cssoMinify" minifier and generate source map: warning 1`] = `
300282
[
301283
"ModuleWarning: Module Warning (from ../../node_modules/sass-loader/dist/cjs.js):
302-
Deprecation The legacy JS API is deprecated and will be removed in Dart Sass 2.0.0.",
303-
"ModuleWarning: Module Warning (from ../../node_modules/sass-loader/dist/cjs.js):
304284
Deprecation Warning on line 0, column 8 of file:///test/fixtures/sourcemap/foo.scss:0:8:",
305285
]
306286
`;
@@ -318,8 +298,6 @@ exports[`"minify" option should work with "CssMinimizerPlugin.cssoMinify" minifi
318298
exports[`"minify" option should work with "CssMinimizerPlugin.cssoMinify" minifier and generate source maps #2: warning 1`] = `
319299
[
320300
"ModuleWarning: Module Warning (from ../../node_modules/sass-loader/dist/cjs.js):
321-
Deprecation The legacy JS API is deprecated and will be removed in Dart Sass 2.0.0.",
322-
"ModuleWarning: Module Warning (from ../../node_modules/sass-loader/dist/cjs.js):
323301
Deprecation Warning on line 0, column 8 of file:///test/fixtures/sourcemap/foo.scss:0:8:",
324302
]
325303
`;
@@ -335,8 +313,6 @@ exports[`"minify" option should work with "CssMinimizerPlugin.cssoMinify" minifi
335313
exports[`"minify" option should work with "CssMinimizerPlugin.cssoMinify" minifier: warning 1`] = `
336314
[
337315
"ModuleWarning: Module Warning (from ../../node_modules/sass-loader/dist/cjs.js):
338-
Deprecation The legacy JS API is deprecated and will be removed in Dart Sass 2.0.0.",
339-
"ModuleWarning: Module Warning (from ../../node_modules/sass-loader/dist/cjs.js):
340316
Deprecation Warning on line 0, column 8 of file:///test/fixtures/sourcemap/foo.scss:0:8:",
341317
]
342318
`;
@@ -373,8 +349,6 @@ exports[`"minify" option should work with "CssMinimizerPlugin.esbuildMinify" min
373349
exports[`"minify" option should work with "CssMinimizerPlugin.esbuildMinify" minifier and generate source maps #2: warning 1`] = `
374350
[
375351
"ModuleWarning: Module Warning (from ../../node_modules/sass-loader/dist/cjs.js):
376-
Deprecation The legacy JS API is deprecated and will be removed in Dart Sass 2.0.0.",
377-
"ModuleWarning: Module Warning (from ../../node_modules/sass-loader/dist/cjs.js):
378352
Deprecation Warning on line 0, column 8 of file:///test/fixtures/sourcemap/foo.scss:0:8:",
379353
]
380354
`;
@@ -404,8 +378,6 @@ exports[`"minify" option should work with "CssMinimizerPlugin.esbuildMinify" min
404378
exports[`"minify" option should work with "CssMinimizerPlugin.esbuildMinify" minifier: warning 1`] = `
405379
[
406380
"ModuleWarning: Module Warning (from ../../node_modules/sass-loader/dist/cjs.js):
407-
Deprecation The legacy JS API is deprecated and will be removed in Dart Sass 2.0.0.",
408-
"ModuleWarning: Module Warning (from ../../node_modules/sass-loader/dist/cjs.js):
409381
Deprecation Warning on line 0, column 8 of file:///test/fixtures/sourcemap/foo.scss:0:8:",
410382
]
411383
`;
@@ -423,8 +395,6 @@ exports[`"minify" option should work with "CssMinimizerPlugin.lightningCssMinify
423395
exports[`"minify" option should work with "CssMinimizerPlugin.lightningCssMinify" minifier and generate source maps #2: warning 1`] = `
424396
[
425397
"ModuleWarning: Module Warning (from ../../node_modules/sass-loader/dist/cjs.js):
426-
Deprecation The legacy JS API is deprecated and will be removed in Dart Sass 2.0.0.",
427-
"ModuleWarning: Module Warning (from ../../node_modules/sass-loader/dist/cjs.js):
428398
Deprecation Warning on line 0, column 8 of file:///test/fixtures/sourcemap/foo.scss:0:8:",
429399
]
430400
`;
@@ -442,8 +412,6 @@ exports[`"minify" option should work with "CssMinimizerPlugin.lightningCssMinify
442412
exports[`"minify" option should work with "CssMinimizerPlugin.lightningCssMinify" minifier and generate source maps: warning 1`] = `
443413
[
444414
"ModuleWarning: Module Warning (from ../../node_modules/sass-loader/dist/cjs.js):
445-
Deprecation The legacy JS API is deprecated and will be removed in Dart Sass 2.0.0.",
446-
"ModuleWarning: Module Warning (from ../../node_modules/sass-loader/dist/cjs.js):
447415
Deprecation Warning on line 0, column 8 of file:///test/fixtures/sourcemap/foo.scss:0:8:",
448416
]
449417
`;
@@ -469,8 +437,6 @@ exports[`"minify" option should work with "CssMinimizerPlugin.lightningCssMinify
469437
exports[`"minify" option should work with "CssMinimizerPlugin.lightningCssMinify" minifier: warning 1`] = `
470438
[
471439
"ModuleWarning: Module Warning (from ../../node_modules/sass-loader/dist/cjs.js):
472-
Deprecation The legacy JS API is deprecated and will be removed in Dart Sass 2.0.0.",
473-
"ModuleWarning: Module Warning (from ../../node_modules/sass-loader/dist/cjs.js):
474440
Deprecation Warning on line 0, column 8 of file:///test/fixtures/sourcemap/foo.scss:0:8:",
475441
]
476442
`;
@@ -488,8 +454,6 @@ exports[`"minify" option should work with "CssMinimizerPlugin.parcelCssMinify" m
488454
exports[`"minify" option should work with "CssMinimizerPlugin.parcelCssMinify" minifier and generate source maps #2: warning 1`] = `
489455
[
490456
"ModuleWarning: Module Warning (from ../../node_modules/sass-loader/dist/cjs.js):
491-
Deprecation The legacy JS API is deprecated and will be removed in Dart Sass 2.0.0.",
492-
"ModuleWarning: Module Warning (from ../../node_modules/sass-loader/dist/cjs.js):
493457
Deprecation Warning on line 0, column 8 of file:///test/fixtures/sourcemap/foo.scss:0:8:",
494458
]
495459
`;
@@ -507,8 +471,6 @@ exports[`"minify" option should work with "CssMinimizerPlugin.parcelCssMinify" m
507471
exports[`"minify" option should work with "CssMinimizerPlugin.parcelCssMinify" minifier and generate source maps: warning 1`] = `
508472
[
509473
"ModuleWarning: Module Warning (from ../../node_modules/sass-loader/dist/cjs.js):
510-
Deprecation The legacy JS API is deprecated and will be removed in Dart Sass 2.0.0.",
511-
"ModuleWarning: Module Warning (from ../../node_modules/sass-loader/dist/cjs.js):
512474
Deprecation Warning on line 0, column 8 of file:///test/fixtures/sourcemap/foo.scss:0:8:",
513475
]
514476
`;
@@ -534,8 +496,6 @@ exports[`"minify" option should work with "CssMinimizerPlugin.parcelCssMinify" m
534496
exports[`"minify" option should work with "CssMinimizerPlugin.parcelCssMinify" minifier: warning 1`] = `
535497
[
536498
"ModuleWarning: Module Warning (from ../../node_modules/sass-loader/dist/cjs.js):
537-
Deprecation The legacy JS API is deprecated and will be removed in Dart Sass 2.0.0.",
538-
"ModuleWarning: Module Warning (from ../../node_modules/sass-loader/dist/cjs.js):
539499
Deprecation Warning on line 0, column 8 of file:///test/fixtures/sourcemap/foo.scss:0:8:",
540500
]
541501
`;
@@ -553,8 +513,6 @@ exports[`"minify" option should work with "CssMinimizerPlugin.swcMinify" minifie
553513
exports[`"minify" option should work with "CssMinimizerPlugin.swcMinify" minifier and generate source maps #2: warning 1`] = `
554514
[
555515
"ModuleWarning: Module Warning (from ../../node_modules/sass-loader/dist/cjs.js):
556-
Deprecation The legacy JS API is deprecated and will be removed in Dart Sass 2.0.0.",
557-
"ModuleWarning: Module Warning (from ../../node_modules/sass-loader/dist/cjs.js):
558516
Deprecation Warning on line 0, column 8 of file:///test/fixtures/sourcemap/foo.scss:0:8:",
559517
]
560518
`;
@@ -572,8 +530,6 @@ exports[`"minify" option should work with "CssMinimizerPlugin.swcMinify" minifie
572530
exports[`"minify" option should work with "CssMinimizerPlugin.swcMinify" minifier and generate source maps: warning 1`] = `
573531
[
574532
"ModuleWarning: Module Warning (from ../../node_modules/sass-loader/dist/cjs.js):
575-
Deprecation The legacy JS API is deprecated and will be removed in Dart Sass 2.0.0.",
576-
"ModuleWarning: Module Warning (from ../../node_modules/sass-loader/dist/cjs.js):
577533
Deprecation Warning on line 0, column 8 of file:///test/fixtures/sourcemap/foo.scss:0:8:",
578534
]
579535
`;
@@ -599,8 +555,6 @@ exports[`"minify" option should work with "CssMinimizerPlugin.swcMinify" minifie
599555
exports[`"minify" option should work with "CssMinimizerPlugin.swcMinify" minifier: warning 1`] = `
600556
[
601557
"ModuleWarning: Module Warning (from ../../node_modules/sass-loader/dist/cjs.js):
602-
Deprecation The legacy JS API is deprecated and will be removed in Dart Sass 2.0.0.",
603-
"ModuleWarning: Module Warning (from ../../node_modules/sass-loader/dist/cjs.js):
604558
Deprecation Warning on line 0, column 8 of file:///test/fixtures/sourcemap/foo.scss:0:8:",
605559
]
606560
`;
@@ -628,8 +582,6 @@ exports[`"minify" option should work with "csso" minifier: error 1`] = `[]`;
628582
exports[`"minify" option should work with "csso" minifier: warning 1`] = `
629583
[
630584
"ModuleWarning: Module Warning (from ../../node_modules/sass-loader/dist/cjs.js):
631-
Deprecation The legacy JS API is deprecated and will be removed in Dart Sass 2.0.0.",
632-
"ModuleWarning: Module Warning (from ../../node_modules/sass-loader/dist/cjs.js):
633585
Deprecation Warning on line 0, column 8 of file:///test/fixtures/sourcemap/foo.scss:0:8:",
634586
]
635587
`;

0 commit comments

Comments
 (0)