/** @type {import('next').NextConfig} */
const nextConfig = {
// Never serve public .js.map files
productionBrowserSourceMaps: false,
};
export default nextConfig;
import { defineConfig } from 'vite';
export default defineConfig({
build: {
// Disable public .js.map output
sourcemap: false,
},
});
vite.config.ts + Sentry CLI
// 1. Emit hidden maps (no sourceMappingURL)
export default defineConfig({
build: { sourcemap: 'hidden' },
});
# 2. Upload privately to Sentry, then delete
npx @sentry/cli sourcemaps upload \
--org YOUR_ORG --project YOUR_APP ./dist
find ./dist -name "*.map" -delete