diff --git a/scripts/lib/plugin-npm-package-manifest.mjs b/scripts/lib/plugin-npm-package-manifest.mjs index 8f9a0181c0d..cf158666bec 100644 --- a/scripts/lib/plugin-npm-package-manifest.mjs +++ b/scripts/lib/plugin-npm-package-manifest.mjs @@ -2,6 +2,7 @@ import { spawnSync } from "node:child_process"; import fs from "node:fs"; import path from "node:path"; import { pathToFileURL } from "node:url"; +import JSON5 from "json5"; const GENERATED_BUNDLED_CHANNEL_CONFIG_METADATA_PATH = "src/config/bundled-channel-config-metadata.generated.ts"; @@ -33,7 +34,7 @@ function readGeneratedBundledChannelConfigs(repoRoot) { let entries; try { - entries = Function(`"use strict"; return (${match[1]});`)(); + entries = JSON5.parse(match[1]); } catch { return new Map(); }