File tree 1 file changed +19
-2
lines changed
1 file changed +19
-2
lines changed Original file line number Diff line number Diff line change @@ -264,12 +264,29 @@ module.exports = {
264
264
new CssMinimizerPlugin ({
265
265
minimizerOptions: [
266
266
{}, // Options for the first function (CssMinimizerPlugin.cssnanoMinify)
267
- {}, // Options for the second function (CssMinimizerPlugin.cleanCssMinify)
267
+ {}, // Options for the second function
268
268
{}, // Options for the third function
269
269
],
270
270
minify: [
271
271
CssMinimizerPlugin .cssnanoMinify ,
272
- CssMinimizerPlugin .cleanCssMinify ,
272
+ async (data , inputMap ) => {
273
+ // eslint-disable-next-line global-require
274
+ const CleanCSS = require (' clean-css' );
275
+
276
+ const [[filename , input ]] = Object .entries (data);
277
+ const minifiedCss = await new CleanCSS ({ sourceMap: true }).minify ({
278
+ [filename]: {
279
+ styles: input,
280
+ sourceMap: inputMap,
281
+ },
282
+ });
283
+
284
+ return {
285
+ code: minifiedCss .styles ,
286
+ map: minifiedCss .sourceMap .toJSON (),
287
+ warnings: minifiedCss .warnings ,
288
+ };
289
+ },
273
290
async (data , inputMap , minimizerOptions ) => {
274
291
// To do something
275
292
return {
You can’t perform that action at this time.
0 commit comments