Unverified Commit 741f6fc9 authored by JJ Kasper's avatar JJ Kasper Committed by GitHub

Revert standalone extension change for module type (#77978)

We don't need to change the extension as the main fix is to ensure the
`package.json` is copied to the standalone folder. The extension change
was for more correctness but can cause breakage for anyone using `type:
'module'` as they will need to update their flows for the new `.mjs`
extension. Since this is un-necessary breakage this reverts that piece
of the fix.

x-ref:
https://github.com/vercel/next.js/pull/77944#discussion_r2035618277
parent 6d5df0ed
...@@ -1687,7 +1687,7 @@ export async function copyTracedFiles( ...@@ -1687,7 +1687,7 @@ export async function copyTracedFiles(
const serverOutputPath = path.join( const serverOutputPath = path.join(
outputPath, outputPath,
path.relative(tracingRoot, dir), path.relative(tracingRoot, dir),
moduleType ? 'server.mjs' : 'server.js' 'server.js'
) )
await fs.mkdir(path.dirname(serverOutputPath), { recursive: true }) await fs.mkdir(path.dirname(serverOutputPath), { recursive: true })
......
...@@ -41,7 +41,7 @@ describe('type-module', () => { ...@@ -41,7 +41,7 @@ describe('type-module', () => {
expect(fs.existsSync(join(standalonePath, 'package.json'))).toBe(true) expect(fs.existsSync(join(standalonePath, 'package.json'))).toBe(true)
const serverFile = join(standalonePath, 'server.mjs') const serverFile = join(standalonePath, 'server.js')
const appPort = await findPort() const appPort = await findPort()
const server = await initNextServerScript( const server = await initNextServerScript(
serverFile, serverFile,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment