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
f8cb26c0
Commit
f8cb26c0
authored
Oct 16, 2025
by
Niklas Mischkulnig
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test case
parent
dc558fd4
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
23 additions
and
3 deletions
+23
-3
index.js
...turbopack/resolving/tsconfig-paths-dynamic/input/index.js
+11
-3
foo.ts
...rbopack/resolving/tsconfig-paths-dynamic/input/src/foo.ts
+8
-0
file1.js
...olving/tsconfig-paths-dynamic/input/sub-override/file1.js
+1
-0
file2.js
...olving/tsconfig-paths-dynamic/input/sub-override/file2.js
+1
-0
file3.js
...olving/tsconfig-paths-dynamic/input/sub-override/file3.js
+1
-0
tsconfig.json
...pack/resolving/tsconfig-paths-dynamic/input/tsconfig.json
+1
-0
No files found.
turbopack/crates/turbopack-tests/tests/execution/turbopack/resolving/tsconfig-paths-dynamic/input/index.js
View file @
f8cb26c0
import
{
loadSub
,
loadSubNested
,
loadSubFallback
}
from
'./src/foo'
import
{
load
,
loadComplex
,
loadSub
,
loadSubNested
,
loadSubFallback
,
}
from
'./src/foo'
it
(
'should support dynamic requests with tsconfig.paths'
,
()
=>
{
it
(
'should support dynamic requests with tsconfig.paths'
,
()
=>
{
expect
(
loadSub
(
'file2.js'
).
default
).
toBe
(
'file2'
)
expect
(
load
(
'sub/file2.js'
).
default
).
toBe
(
'file2'
)
expect
(
loadSub
(
'file2.js'
).
default
).
toBe
(
'file2-override'
)
expect
(
loadComplex
(
'sub'
,
'file2'
,
'js'
).
default
).
toBe
(
'file2'
)
})
})
it
(
'should support dynamic requests with tsconfig.paths and without extension'
,
()
=>
{
it
(
'should support dynamic requests with tsconfig.paths and without extension'
,
()
=>
{
expect
(
loadSub
(
'file2'
).
default
).
toBe
(
'file2'
)
expect
(
loadSub
(
'file2'
).
default
).
toBe
(
'file2
-override
'
)
})
})
it
(
'should support dynamic requests with tsconfig.paths and multiple dynamic parts'
,
()
=>
{
it
(
'should support dynamic requests with tsconfig.paths and multiple dynamic parts'
,
()
=>
{
...
...
turbopack/crates/turbopack-tests/tests/execution/turbopack/resolving/tsconfig-paths-dynamic/input/src/foo.ts
View file @
f8cb26c0
export
function
load
(
v
:
string
)
{
return
require
(
`@/
${
v
}
`
)
}
export
function
loadComplex
(
dir
:
string
,
name
:
string
,
ext
:
string
)
{
return
require
(
`@/
${
dir
}
/
${
name
}
/
${
ext
}
`
)
}
export
function
loadSub
(
v
:
string
)
{
export
function
loadSub
(
v
:
string
)
{
return
require
(
`@/sub/
${
v
}
`
)
return
require
(
`@/sub/
${
v
}
`
)
}
}
...
...
turbopack/crates/turbopack-tests/tests/execution/turbopack/resolving/tsconfig-paths-dynamic/input/sub-override/file1.js
0 → 100644
View file @
f8cb26c0
export
default
'file1-override'
turbopack/crates/turbopack-tests/tests/execution/turbopack/resolving/tsconfig-paths-dynamic/input/sub-override/file2.js
0 → 100644
View file @
f8cb26c0
export
default
'file2-override'
turbopack/crates/turbopack-tests/tests/execution/turbopack/resolving/tsconfig-paths-dynamic/input/sub-override/file3.js
0 → 100644
View file @
f8cb26c0
export
default
'file3-override'
turbopack/crates/turbopack-tests/tests/execution/turbopack/resolving/tsconfig-paths-dynamic/input/tsconfig.json
View file @
f8cb26c0
...
@@ -2,6 +2,7 @@
...
@@ -2,6 +2,7 @@
"compilerOptions"
:
{
"compilerOptions"
:
{
"paths"
:
{
"paths"
:
{
"@/*"
:
[
"./*"
],
"@/*"
:
[
"./*"
],
"@/sub/*"
:
[
"./sub-override/*"
],
"@sub/*"
:
[
"./sub/*"
,
"./sub-fallback/*"
]
"@sub/*"
:
[
"./sub/*"
,
"./sub-fallback/*"
]
}
}
}
}
...
...
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