(ctx: ExternalAssetContext, entryPath: string, content: Buffer)
| 292 | } |
| 293 | |
| 294 | function localizeHtmlEntry(ctx: ExternalAssetContext, entryPath: string, content: Buffer): void { |
| 295 | const referrerAbsDir = resolve(ctx.absProjectDir, dirname(entryPath)); |
| 296 | const { document } = parseHTML(content.toString("utf-8")); |
| 297 | const attrsChanged = rewriteHtmlAttributes(ctx, document, referrerAbsDir, entryPath); |
| 298 | const stylesChanged = rewriteStyleBlocks(ctx, document, referrerAbsDir, entryPath); |
| 299 | if (attrsChanged || stylesChanged) { |
| 300 | ctx.fileContents.set(entryPath, Buffer.from(document.toString(), "utf-8")); |
| 301 | } |
| 302 | } |
| 303 | |
| 304 | function localizeCssEntry(ctx: ExternalAssetContext, entryPath: string, content: Buffer): void { |
| 305 | const referrerAbsDir = resolve(ctx.absProjectDir, dirname(entryPath)); |
no test coverage detected