diff --git a/packages/next/src/build/flying-shuttle/detect-changed-entries.ts b/packages/next/src/build/flying-shuttle/detect-changed-entries.ts index 76129bf65d145..b8411119d6bbf 100644 --- a/packages/next/src/build/flying-shuttle/detect-changed-entries.ts +++ b/packages/next/src/build/flying-shuttle/detect-changed-entries.ts @@ -275,11 +275,7 @@ export async function detectChangedEntries({ } for (const entry of appPaths || []) { - let normalizedEntry = getPageFromPath(entry, pageExtensions) - - if (normalizedEntry === '/not-found') { - normalizedEntry = '/_not-found' - } + const normalizedEntry = getPageFromPath(entry, pageExtensions) await detectChange({ entry, normalizedEntry, type: 'app' }) } diff --git a/packages/next/src/build/flying-shuttle/stitch-builds.ts b/packages/next/src/build/flying-shuttle/stitch-builds.ts index 860fec6a6d642..acc3667cb39ae 100644 --- a/packages/next/src/build/flying-shuttle/stitch-builds.ts +++ b/packages/next/src/build/flying-shuttle/stitch-builds.ts @@ -114,6 +114,17 @@ export async function stitchBuilds( path.join(shuttleDir, entryFile), path.join(distDir, entryFile) ) + // copy map file as well if it exists + await fs.promises + .copyFile( + path.join(shuttleDir, `${entryFile}.map`), + path.join(distDir, `${entryFile}.map`) + ) + .catch((err) => { + if (err.code !== 'ENOENT') { + throw err + } + }) } const copySema = new Sema(8) diff --git a/packages/next/src/build/webpack/plugins/define-env-plugin.ts b/packages/next/src/build/webpack/plugins/define-env-plugin.ts index 730d9e0d12207..cc7aac3d0317e 100644 --- a/packages/next/src/build/webpack/plugins/define-env-plugin.ts +++ b/packages/next/src/build/webpack/plugins/define-env-plugin.ts @@ -282,7 +282,7 @@ export function getDefineEnv({ } const serializedDefineEnv = serializeDefineEnv(defineEnv) - if (Boolean(config.experimental.flyingShuttle)) { + if (!dev && Boolean(config.experimental.flyingShuttle)) { // we delay inlining these values until after the build // with flying shuttle enabled so we can update them // without invalidating entries