mirror of
https://github.com/MercuryWorkshop/scramjet.git
synced 2025-05-14 23:10:02 -04:00
initial commit
This commit is contained in:
commit
d7b4a8bd31
22 changed files with 3411 additions and 0 deletions
7
src/bundle/rewriters/css.ts
Normal file
7
src/bundle/rewriters/css.ts
Normal file
|
@ -0,0 +1,7 @@
|
|||
import { encodeUrl } from "./url"
|
||||
|
||||
export function rewriteCss(css: string, origin?: string) {
|
||||
css = css.replace(/(?<=url\("?'?)[^"'][\S]*[^"'](?="?'?\);?)/g, (match) => encodeUrl(match, origin));
|
||||
|
||||
return "/* intercepted by scramjet 🐳 */" + css;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue