MCPcopy Create free account
hub / github.com/heygen-com/hyperframes / localizeCssEntry

Function localizeCssEntry

packages/cli/src/utils/publishProject.ts:304–312  ·  view source on GitHub ↗
(ctx: ExternalAssetContext, entryPath: string, content: Buffer)

Source from the content-addressed store, hash-verified

302}
303
304function localizeCssEntry(ctx: ExternalAssetContext, entryPath: string, content: Buffer): void {
305 const referrerAbsDir = resolve(ctx.absProjectDir, dirname(entryPath));
306 const css = content.toString("utf-8");
307 if (!css.includes("url(")) return;
308 const result = rewriteCssUrls(ctx, css, referrerAbsDir, entryPath);
309 if (result.modified) {
310 ctx.fileContents.set(entryPath, Buffer.from(result.css, "utf-8"));
311 }
312}
313
314/**
315 * Scan HTML and CSS files for asset references that resolve outside the

Callers 1

localizeExternalAssetsFunction · 0.85

Calls 4

resolveFunction · 0.85
rewriteCssUrlsFunction · 0.85
fromMethod · 0.80
setMethod · 0.65

Tested by

no test coverage detected