critters icon indicating copy to clipboard operation
critters copied to clipboard

Duplicated styles when using `additionalStylesheets` option

Open rschristian opened this issue 2 years ago • 2 comments

The test added in #87 acts as a reproduction.

The basic gist of the issue is that the pattern used for additionalStylesheets can match the main CSS file, which causes its styles to be duplicated.

If we use a pattern like *.css, the sheet's contents will be added once from additionalStylesheets() and again from embedLinkedStylesheets().

It seems that in the past the use of cssnano deduped these styles and hid the issue, though the current solution doesn't offer that same benefit.

Not sure whether this is a regression or just chance behavior that was relied upon.

rschristian avatar Nov 10 '21 10:11 rschristian

I've run into this as well in the past week.

developit avatar Jan 05 '22 16:01 developit

It looks like we'll need to bring back the option of running stylesheets through cssnano.

developit avatar Jan 05 '22 16:01 developit