Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
N
next.js
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Alex
next.js
Commits
d0c8732b
Commit
d0c8732b
authored
Aug 29, 2025
by
devjiwonchoi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
extract mts support
parent
97264672
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
4 deletions
+2
-4
transpile-config.ts
packages/next/src/build/next-config-ts/transpile-config.ts
+1
-1
config.ts
packages/next/src/server/config.ts
+1
-3
No files found.
packages/next/src/build/next-config-ts/transpile-config.ts
View file @
d0c8732b
...
@@ -148,7 +148,7 @@ export async function transpileConfig({
...
@@ -148,7 +148,7 @@ export async function transpileConfig({
pkgJson
=
JSON
.
parse
(
await
readFile
(
join
(
cwd
,
'package.json'
),
'utf8'
))
pkgJson
=
JSON
.
parse
(
await
readFile
(
join
(
cwd
,
'package.json'
),
'utf8'
))
}
catch
{}
}
catch
{}
if
(
configFileName
.
endsWith
(
'.mts'
)
||
pkgJson
.
type
===
'module'
)
{
if
(
pkgJson
.
type
===
'module'
)
{
return
handleESM
({
cwd
,
compilerOptions
,
nextConfigPath
,
phase
})
return
handleESM
({
cwd
,
compilerOptions
,
nextConfigPath
,
phase
})
}
}
...
...
packages/next/src/server/config.ts
View file @
d0c8732b
...
@@ -1389,9 +1389,7 @@ export default async function loadConfig(
...
@@ -1389,9 +1389,7 @@ export default async function loadConfig(
let
userConfigModule
:
any
let
userConfigModule
:
any
try
{
try
{
const
envBefore
=
Object
.
assign
({},
process
.
env
)
const
envBefore
=
Object
.
assign
({},
process
.
env
)
const
shouldTranspile
=
const
shouldTranspile
=
configFileName
===
'next.config.ts'
configFileName
===
'next.config.ts'
||
configFileName
===
'next.config.mts'
// `import()` expects url-encoded strings, so the path must be properly
// `import()` expects url-encoded strings, so the path must be properly
// escaped and (especially on Windows) absolute paths must pe prefixed
// escaped and (especially on Windows) absolute paths must pe prefixed
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment