Skip to content

Commit

Permalink
chore: Prevent upload sourcemap script from running in non-dev-portal…
Browse files Browse the repository at this point in the history
… builds (#2534)
  • Loading branch information
heatlikeheatwave authored Aug 1, 2024
1 parent 73bf5a1 commit 18dedf6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
6 changes: 5 additions & 1 deletion next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,11 @@ module.exports = withHashicorp({
webpack(config) {
config.plugins.push(HashiConfigPlugin())

if (process.env.VERCEL_ENV && process.env.VERCEL_ENV !== 'development') {
if (
typeof process.env.DATADOG_API_KEY !== 'undefined' &&
process.env.VERCEL_ENV &&
process.env.VERCEL_ENV !== 'development'
) {
config.devtool = 'hidden-source-map'
}

Expand Down
1 change: 1 addition & 0 deletions scripts/upload-source-maps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { execSync } from 'child_process'
*/
const main = () => {
if (
typeof process.env.DATADOG_API_KEY === 'undefined' ||
typeof process.env.VERCEL_ENV === 'undefined' ||
process.env.VERCEL_ENV === 'development'
) {
Expand Down

0 comments on commit 18dedf6

Please sign in to comment.