Skip to content

Commit

Permalink
feat(server): enable source map support for stack traces in dev (#172)
Browse files Browse the repository at this point in the history
Release-as: 0.13.2
  • Loading branch information
ValeraS authored Dec 27, 2024
1 parent e6021bc commit 079ba60
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/commands/dev/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@ export default async function (config: NormalizedServiceConfig) {
const startNodemon = () => {
if (needToStartNodemon && serverCompiled && clientCompiled) {
logger.message('Starting application at', serverPath);
const nodeArgs = ['--enable-source-maps'];
if (inspect || inspectBrk) {
nodeArgs.push(
`--${inspect ? 'inspect' : 'inspect-brk'}=:::${inspect || inspectBrk}`,
);
}

const serverWatch = config.server.watch ?? [];
const delay = config.server.watchThrottle;
Expand All @@ -41,10 +47,7 @@ export default async function (config: NormalizedServiceConfig) {
env: {
...(config.server.port ? {APP_PORT: config.server.port} : undefined),
},
nodeArgs:
inspect || inspectBrk
? [`--${inspect ? 'inspect' : 'inspect-brk'}=:::${inspect || inspectBrk}`]
: undefined,
nodeArgs,
watch: [serverPath, ...serverWatch],
delay,
});
Expand Down

0 comments on commit 079ba60

Please sign in to comment.