Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/angular/build/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"beasties": "0.4.1",
"browserslist": "^4.26.0",
"esbuild": "0.27.3",
"https-proxy-agent": "7.0.6",
"https-proxy-agent": "8.0.0",
"istanbul-lib-instrument": "6.0.3",
"jsonc-parser": "3.3.1",
"listr2": "10.2.1",
Expand Down
21 changes: 18 additions & 3 deletions packages/angular/build/src/utils/index-file/inline-fonts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,9 @@
* found in the LICENSE file at https://angular.dev/license
*/

import { HttpsProxyAgent } from 'https-proxy-agent';
import { createHash } from 'node:crypto';
import { readFile, rm, writeFile } from 'node:fs/promises';
import { get as httpsGet } from 'node:https';
import { type Agent, get as httpsGet } from 'node:https';
import { join } from 'node:path';
import { NormalizedCachedOptions } from '../normalize-cache';
import { htmlRewritingStream } from './html-rewriting-stream';
Expand Down Expand Up @@ -195,12 +194,28 @@ export class InlineFontsProcessor {
}

const httpsProxy = process.env.HTTPS_PROXY ?? process.env.https_proxy;
let agent: Agent | undefined;
if (httpsProxy) {
// TODO: Remove `https-proxy-agent` usage once the min supported version of Node.js is 24.5.0
// https.globalAgent = new https.Agent({
// proxyEnv: { HTTPS_PROXY: 'http://proxy.company.com:8080' },
// });
// See: https://nodejs.org/en/learn/http/enterprise-network-configuration
// See: https://nodejs.org/docs/latest/api/https.html

const { HttpsProxyAgent } = (await import('https-proxy-agent' as string)) as typeof import(
'https-proxy-agent',
{ with: { 'resolution-mode': 'import' } }
);
agent = new HttpsProxyAgent(httpsProxy) as unknown as Agent;
}

const data = await new Promise<string>((resolve, reject) => {
let rawResponse = '';
httpsGet(
url,
{
agent: httpsProxy ? new HttpsProxyAgent(httpsProxy) : undefined,
agent,
headers: {
/**
* Always use a Windows UA. This is because Google fonts will including hinting in fonts for Windows.
Expand Down
21 changes: 19 additions & 2 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading