#!/usr/bin/env node // Deploy gate: fail a build whose output would publish source maps. // // Production maps go to Sentry only (shared/source-map-policy.ts). The Vite // configs and the wm-strip-private-source-maps plugin enforce that; this gate // re-checks the final tree after every build step (blog, /pro, dashboard, // embed plugin) so a new bundler, plugin, or copied public/ file cannot // reintroduce a public map unnoticed. Previews and opted-in local builds, // which publish maps deliberately, skip the check. // // Usage: node --import tsx scripts/check-no-public-source-maps.mjs [dir=dist] import { readdir, readFile } from 'node:fs/promises'; import { join, relative } from 'node:path'; import { pathToFileURL } from 'node:url'; import { shouldEmitPublicSourceMaps } from '../shared/source-map-policy.ts'; const SOURCE_MAP_FILE = /\.map(\.br|\.gz)?$/i; // HTML too: an inline