Skip to content

Commit

Permalink
fix: deploy URL not set right for all CSS 'url' references (e.g. font…
Browse files Browse the repository at this point in the history
…s) (#1521)

* deploy URL was falsely  set for `url(data:` references
* the matcher selected `url(data` references and included the first `url(/assets/` in this match so ist was not treated seperatly failing to add the deploy URL
  • Loading branch information
shauke authored Oct 19, 2023
1 parent 8c2c203 commit e6d4dfb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/ssr/deploy-url.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export function setDeployUrlInFile(deployUrl: string, path: string, input: strin

let newInput = input;

const cssRegex = /url\((?!http)\/?(assets.*?|[a-zA-Z].*?woff2?)\)/g;
const cssRegex = /url\((?!http|data)\/?(assets.*?|[a-zA-Z].*?woff2?)\)/g;
if (cssRegex.test(newInput)) {
newInput = newInput.replace(cssRegex, (...args) => `url(${deployUrl}${args[1]})`);
}
Expand Down

0 comments on commit e6d4dfb

Please sign in to comment.