From 24770815b466342cf165b4db13b23df6076a1317 Mon Sep 17 00:00:00 2001 From: Cosmin Popovici Date: Mon, 22 Jul 2024 17:45:08 +0300 Subject: [PATCH] chore: build for production --- dist/index.cjs | 4 ++-- dist/index.mjs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/dist/index.cjs b/dist/index.cjs index a78f5c0..f1554b3 100644 --- a/dist/index.cjs +++ b/dist/index.cjs @@ -26,7 +26,7 @@ function postcssBaseurl(options = {}) { rule.walkDecls((decl) => { const { value } = decl; decl.value = value.replace(urlPattern, ($0, $1, $2, $3) => { - return isUrl__default($2) ? $1 + $2 + $3 : $1 + base + $2 + $3; + return isUrl__default($2) ? $1 + $2 + $3 : isUrl__default(base) ? $1 + base + $2 + $3 : $1 + path__default.join(base, $2) + $3; }); }); } @@ -35,7 +35,7 @@ function postcssBaseurl(options = {}) { rule.walkDecls((decl) => { const { value } = decl; decl.value = value.replace(urlPattern, ($0, $1, $2, $3) => { - return isUrl__default($2) ? $1 + $2 + $3 : $1 + base + $2 + $3; + return isUrl__default($2) ? $1 + $2 + $3 : isUrl__default(base) ? $1 + base + $2 + $3 : $1 + path__default.join(base, $2) + $3; }); }); }); diff --git a/dist/index.mjs b/dist/index.mjs index 64ac994..9367a87 100644 --- a/dist/index.mjs +++ b/dist/index.mjs @@ -17,7 +17,7 @@ function postcssBaseurl(options = {}) { rule.walkDecls((decl) => { const { value } = decl; decl.value = value.replace(urlPattern, ($0, $1, $2, $3) => { - return isUrl($2) ? $1 + $2 + $3 : $1 + base + $2 + $3; + return isUrl($2) ? $1 + $2 + $3 : isUrl(base) ? $1 + base + $2 + $3 : $1 + path.join(base, $2) + $3; }); }); } @@ -26,7 +26,7 @@ function postcssBaseurl(options = {}) { rule.walkDecls((decl) => { const { value } = decl; decl.value = value.replace(urlPattern, ($0, $1, $2, $3) => { - return isUrl($2) ? $1 + $2 + $3 : $1 + base + $2 + $3; + return isUrl($2) ? $1 + $2 + $3 : isUrl(base) ? $1 + base + $2 + $3 : $1 + path.join(base, $2) + $3; }); }); });