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
64e41416
Unverified
Commit
64e41416
authored
Nov 02, 2021
by
Tim Neutkens
Committed by
GitHub
Nov 02, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add regenerator path (#30786)
parent
e79f788f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
1 deletion
+23
-1
next-swc-loader.js
packages/next/build/webpack/loaders/next-swc-loader.js
+3
-0
regenerator.js
test/integration/pnpm-support/app/pages/regenerator.js
+12
-0
index.test.js
test/integration/pnpm-support/test/index.test.js
+8
-1
No files found.
packages/next/build/webpack/loaders/next-swc-loader.js
View file @
64e41416
...
@@ -70,6 +70,9 @@ function getSWCOptions({
...
@@ -70,6 +70,9 @@ function getSWCOptions({
},
},
},
},
},
},
regenerator
:
{
importPath
:
require
.
resolve
(
'regenerator-runtime'
),
},
},
},
}
}
...
...
test/integration/pnpm-support/app/pages/regenerator.js
0 → 100644
View file @
64e41416
import
{
useState
,
useEffect
}
from
'react'
export
default
function
RegeneratorTest
()
{
const
[
message
,
setMessage
]
=
useState
(
''
)
useEffect
(()
=>
{
;(
async
()
=>
{
await
new
Promise
((
resolve
)
=>
setTimeout
(
resolve
,
50
))
setMessage
(
'Hello World'
)
})()
},
[])
return
<
h1
>
{
message
}
<
/h1
>
}
test/integration/pnpm-support/test/index.test.js
View file @
64e41416
...
@@ -8,7 +8,14 @@ const packagesDir = path.join(__dirname, '..', '..', '..', '..', 'packages')
...
@@ -8,7 +8,14 @@ const packagesDir = path.join(__dirname, '..', '..', '..', '..', 'packages')
const
appDir
=
path
.
join
(
__dirname
,
'..'
,
'app'
)
const
appDir
=
path
.
join
(
__dirname
,
'..'
,
'app'
)
const
runNpm
=
(
cwd
,
...
args
)
=>
execa
(
'npm'
,
[...
args
],
{
cwd
})
const
runNpm
=
(
cwd
,
...
args
)
=>
execa
(
'npm'
,
[...
args
],
{
cwd
})
const
runPnpm
=
(
cwd
,
...
args
)
=>
execa
(
'npx'
,
[
'pnpm'
,
...
args
],
{
cwd
})
const
runPnpm
=
async
(
cwd
,
...
args
)
=>
{
try
{
return
await
execa
(
'npx'
,
[
'pnpm'
,
...
args
],
{
cwd
})
}
catch
(
err
)
{
console
.
error
({
err
})
throw
err
}
}
async
function
usingTempDir
(
fn
)
{
async
function
usingTempDir
(
fn
)
{
const
folder
=
path
.
join
(
os
.
tmpdir
(),
Math
.
random
().
toString
(
36
).
substring
(
2
))
const
folder
=
path
.
join
(
os
.
tmpdir
(),
Math
.
random
().
toString
(
36
).
substring
(
2
))
...
...
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