Skip to content

Commit

Permalink
fixed newline minification in selectors
Browse files Browse the repository at this point in the history
  • Loading branch information
jleeson committed Oct 23, 2024
1 parent faa3bc6 commit 85aa4d0
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,7 @@ export default (options = {}) => {
const minifyCSS = (content) => {
const comments = /("(?:[^"\\]+|\\.)*"|'(?:[^'\\]+|\\.)*')|\/\*[\s\S]*?\*\//g;
const syntax = /("(?:[^"\\]+|\\.)*"|'(?:[^'\\]+|\\.)*')|\s*([{};,>~])\s*|\s*([*$~^|]?=)\s*|\s+([+-])(?=.*\{)|([[(:])\s+|\s+([\])])|\s+(:)(?![^}]*\{)|^\s+|\s+$|(\s)\s+(?![^(]*\))/g;

content = content.replace(comments, "$1");
content = content.replace(syntax, "$1$2$3$4$5$6$7$8");
content = content.replace(/\n+/g, "");

return content;
return content.replace(comments, "$1").replace(syntax, "$1$2$3$4$5$6$7$8").replace(/\n+/g, " ");
};

return {
Expand Down

0 comments on commit 85aa4d0

Please sign in to comment.