Skip to content

Commit 741f6fc

Browse files
authored
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: #77944 (comment)
1 parent 6d5df0e commit 741f6fc

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

packages/next/src/build/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1687,7 +1687,7 @@ export async function copyTracedFiles(
16871687
const serverOutputPath = path.join(
16881688
outputPath,
16891689
path.relative(tracingRoot, dir),
1690-
moduleType ? 'server.mjs' : 'server.js'
1690+
'server.js'
16911691
)
16921692
await fs.mkdir(path.dirname(serverOutputPath), { recursive: true })
16931693

test/production/standalone-mode/type-module/index.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ describe('type-module', () => {
4141

4242
expect(fs.existsSync(join(standalonePath, 'package.json'))).toBe(true)
4343

44-
const serverFile = join(standalonePath, 'server.mjs')
44+
const serverFile = join(standalonePath, 'server.js')
4545
const appPort = await findPort()
4646
const server = await initNextServerScript(
4747
serverFile,

0 commit comments

Comments
 (0)