Skip to content

Commit

Permalink
Allow opt-out
Browse files Browse the repository at this point in the history
  • Loading branch information
eps1lon committed Oct 25, 2024
1 parent b800ff1 commit 8d9f5bc
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
"lint-staged": "lint-staged",
"next-with-deps": "./scripts/next-with-deps.sh",
"next": "cross-env NEXT_TELEMETRY_DISABLED=1 node --trace-deprecation --enable-source-maps packages/next/dist/bin/next",
"next-no-sourcemaps": "cross-env NEXT_TELEMETRY_DISABLED=1 node --trace-deprecation packages/next/dist/bin/next",
"next-no-sourcemaps": "echo 'No longer supported. Use `pnpm next --disable-source-maps` instead'; exit 1;",
"clean-trace-jaeger": "node scripts/rm.mjs test/integration/basic/.next && TRACE_TARGET=JAEGER pnpm next build test/integration/basic",
"debug": "cross-env NEXT_TELEMETRY_DISABLED=1 node --inspect --trace-deprecation --enable-source-maps packages/next/dist/bin/next",
"postinstall": "node scripts/git-configure.mjs && node scripts/install-native.mjs",
Expand Down
5 changes: 5 additions & 0 deletions packages/next/src/bin/next.ts
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,11 @@ program
'-H, --hostname <hostname>',
'Specify a hostname on which to start the application (default: 0.0.0.0).'
)
.option(
'--disable-source-maps',
"Don't start the Dev server with `--enable-source-maps`.",
false
)
.option(
'--experimental-https',
'Starts the server with HTTPS and generates a self-signed certificate.'
Expand Down
5 changes: 4 additions & 1 deletion packages/next/src/cli/next-dev.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ import { clearTimeout } from 'timers'
import { flushAllTraces, trace } from '../trace'

export type NextDevOptions = {
disableSourceMaps: boolean
turbo?: boolean
turbopack?: boolean
port: number
Expand Down Expand Up @@ -265,7 +266,9 @@ const nextDev = async (
delete nodeOptions['max_old_space_size']
}

nodeOptions['enable-source-maps'] = true
if (!options.disableSourceMaps) {
nodeOptions['enable-source-maps'] = true
}

if (nodeDebugType) {
const address = getParsedDebugAddress()
Expand Down

0 comments on commit 8d9f5bc

Please sign in to comment.