From f8f4eecc1540e9973c517eb7093c9766bad1564d Mon Sep 17 00:00:00 2001 From: Khafra Date: Sun, 11 Feb 2024 12:23:40 -0500 Subject: [PATCH] convert node build to latin1 (#2673) --- package.json | 2 +- scripts/strip-comments.js | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 scripts/strip-comments.js diff --git a/package.json b/package.json index 7e4f45594d4..acbb493382d 100644 --- a/package.json +++ b/package.json @@ -71,7 +71,7 @@ "docs" ], "scripts": { - "build:node": "npx esbuild@0.19.4 index-fetch.js --bundle --platform=node --outfile=undici-fetch.js --define:esbuildDetection=1 --keep-names", + "build:node": "npx esbuild@0.19.4 index-fetch.js --bundle --platform=node --outfile=undici-fetch.js --define:esbuildDetection=1 --keep-names && node scripts/strip-comments.js", "prebuild:wasm": "node build/wasm.js --prebuild", "build:wasm": "node build/wasm.js --docker", "lint": "standard | snazzy", diff --git a/scripts/strip-comments.js b/scripts/strip-comments.js new file mode 100644 index 00000000000..9e4396a5dea --- /dev/null +++ b/scripts/strip-comments.js @@ -0,0 +1,8 @@ +'use strict' + +const { readFileSync, writeFileSync } = require('node:fs') +const { transcode } = require('node:buffer') + +const buffer = transcode(readFileSync('./undici-fetch.js'), 'utf8', 'latin1') + +writeFileSync('./undici-fetch.js', buffer.toString('latin1'))