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
88fd9a0d
Unverified
Commit
88fd9a0d
authored
Apr 29, 2020
by
JJ Kasper
Committed by
GitHub
Apr 29, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update jsconfig paths fix for windows (#12328)
parent
c1aeaa48
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
5 deletions
+10
-5
jsconfig-paths-plugin.ts
packages/next/build/webpack/plugins/jsconfig-paths-plugin.ts
+10
-5
No files found.
packages/next/build/webpack/plugins/jsconfig-paths-plugin.ts
View file @
88fd9a0d
...
@@ -3,8 +3,8 @@
...
@@ -3,8 +3,8 @@
* The TypeScript license can be found here:
* The TypeScript license can be found here:
* https://github.com/microsoft/TypeScript/blob/214df64e287804577afa1fea0184c18c40f7d1ca/LICENSE.txt
* https://github.com/microsoft/TypeScript/blob/214df64e287804577afa1fea0184c18c40f7d1ca/LICENSE.txt
*/
*/
import
path
from
'path'
import
{
ResolvePlugin
}
from
'webpack'
import
{
ResolvePlugin
}
from
'webpack'
import
{
join
}
from
'path'
import
{
debug
}
from
'next/dist/compiled/debug'
import
{
debug
}
from
'next/dist/compiled/debug'
const
log
=
debug
(
'next:jsconfig-paths-plugin'
)
const
log
=
debug
(
'next:jsconfig-paths-plugin'
)
...
@@ -170,7 +170,10 @@ export class JsConfigPathsPlugin implements ResolvePlugin {
...
@@ -170,7 +170,10 @@ export class JsConfigPathsPlugin implements ResolvePlugin {
return
return
}
}
if
(
moduleName
.
startsWith
(
'/'
))
{
if
(
path
.
posix
.
isAbsolute
(
moduleName
)
||
(
process
.
platform
===
'win32'
&&
path
.
win32
.
isAbsolute
(
moduleName
))
)
{
log
(
'skipping request as it is an absolute path %s'
,
moduleName
)
log
(
'skipping request as it is an absolute path %s'
,
moduleName
)
return
return
}
}
...
@@ -199,14 +202,16 @@ export class JsConfigPathsPlugin implements ResolvePlugin {
...
@@ -199,14 +202,16 @@ export class JsConfigPathsPlugin implements ResolvePlugin {
let
triedPaths
=
[]
let
triedPaths
=
[]
for
(
const
subst
of
paths
[
matchedPatternText
])
{
for
(
const
subst
of
paths
[
matchedPatternText
])
{
const
path
=
matchedStar
?
subst
.
replace
(
'*'
,
matchedStar
)
:
subst
const
curPath
=
matchedStar
?
subst
.
replace
(
'*'
,
matchedStar
)
:
subst
// Ensure .d.ts is not matched
// Ensure .d.ts is not matched
if
(
p
ath
.
endsWith
(
'.d.ts'
))
{
if
(
curP
ath
.
endsWith
(
'.d.ts'
))
{
continue
continue
}
}
const
candidate
=
join
(
baseDirectory
,
p
ath
)
const
candidate
=
path
.
join
(
baseDirectory
,
curP
ath
)
const
[
err
,
result
]
=
await
new
Promise
(
resolve
=>
{
const
[
err
,
result
]
=
await
new
Promise
(
resolve
=>
{
const
obj
=
Object
.
assign
({},
request
,
{
const
obj
=
Object
.
assign
({},
request
,
{
request
:
candidate
,
request
:
candidate
,
...
...
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