Skip to content

Commit

Permalink
chore: build for production
Browse files Browse the repository at this point in the history
  • Loading branch information
cossssmin committed Jul 22, 2024
1 parent 4a6435d commit 2477081
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions dist/index.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
});
});
}
Expand All @@ -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;
});
});
});
Expand Down
4 changes: 2 additions & 2 deletions dist/index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
});
});
}
Expand All @@ -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;
});
});
});
Expand Down

0 comments on commit 2477081

Please sign in to comment.