Skip to content

Commit 81856fd

Browse files
committed
build: update dependency https-proxy-agent to v8
See associated pull request for more information. Closes #32762 as a pr takeover
1 parent cb57740 commit 81856fd

File tree

3 files changed

+31
-6
lines changed

3 files changed

+31
-6
lines changed

packages/angular/build/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
"beasties": "0.4.1",
2929
"browserslist": "^4.26.0",
3030
"esbuild": "0.27.3",
31-
"https-proxy-agent": "7.0.6",
31+
"https-proxy-agent": "8.0.0",
3232
"istanbul-lib-instrument": "6.0.3",
3333
"jsonc-parser": "3.3.1",
3434
"listr2": "10.2.1",

packages/angular/build/src/utils/index-file/inline-fonts.ts

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,9 @@
66
* found in the LICENSE file at https://angular.dev/license
77
*/
88

9-
import { HttpsProxyAgent } from 'https-proxy-agent';
109
import { createHash } from 'node:crypto';
1110
import { readFile, rm, writeFile } from 'node:fs/promises';
12-
import { get as httpsGet } from 'node:https';
11+
import { type Agent, get as httpsGet } from 'node:https';
1312
import { join } from 'node:path';
1413
import { NormalizedCachedOptions } from '../normalize-cache';
1514
import { htmlRewritingStream } from './html-rewriting-stream';
@@ -195,12 +194,21 @@ export class InlineFontsProcessor {
195194
}
196195

197196
const httpsProxy = process.env.HTTPS_PROXY ?? process.env.https_proxy;
197+
let agent: Agent | undefined;
198+
if (httpsProxy) {
199+
const { HttpsProxyAgent } = (await import('https-proxy-agent' as string)) as typeof import(
200+
'https-proxy-agent',
201+
{ with: { 'resolution-mode': 'import' } }
202+
);
203+
agent = new HttpsProxyAgent(httpsProxy) as unknown as Agent;
204+
}
205+
198206
const data = await new Promise<string>((resolve, reject) => {
199207
let rawResponse = '';
200208
httpsGet(
201209
url,
202210
{
203-
agent: httpsProxy ? new HttpsProxyAgent(httpsProxy) : undefined,
211+
agent,
204212
headers: {
205213
/**
206214
* Always use a Windows UA. This is because Google fonts will including hinting in fonts for Windows.

pnpm-lock.yaml

Lines changed: 19 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)