Skip to content

Commit

Permalink
feat(@nguniversal/builders): add sourcemap mapping support for dev-se…
Browse files Browse the repository at this point in the history
…rver

Note: this requires Node.js 18.10 or later due to nodejs/node#44654

Closes #2813
  • Loading branch information
alan-agius4 committed Oct 7, 2022
1 parent 3afd47b commit 0897933
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions modules/builders/src/ssr-dev-server/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ function startNodeServer(
const path = join(outputPath, 'main.js');
const env = { ...process.env, PORT: '' + port };

const args = [`"${path}"`];
const args = ['--enable-source-maps', `"${path}"`];
if (inspectMode) {
args.unshift('--inspect-brk');
}
Expand All @@ -190,7 +190,8 @@ function startNodeServer(
switchMap(() => spawnAsObservable('node', args, { env, shell: true })),
tap(({ stderr, stdout }) => {
if (stderr) {
logger.error(stderr);
// Strip the webpack scheme (webpack://) from error log.
logger.error(stderr.replace(/webpack:\/\//g, '.'));
}

if (stdout && !IGNORED_STDOUT_MESSAGES.some((x) => stdout.includes(x))) {
Expand Down

0 comments on commit 0897933

Please sign in to comment.