From 85aa4d0f8c918fce3ec447ed2523078f8a43d5e5 Mon Sep 17 00:00:00 2001 From: jleeson Date: Wed, 23 Oct 2024 10:59:30 -0700 Subject: [PATCH] fixed newline minification in selectors --- src/index.js | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/index.js b/src/index.js index 9fe576e..c1bb7da 100644 --- a/src/index.js +++ b/src/index.js @@ -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 {