Unverified Commit 64e41416 authored by Tim Neutkens's avatar Tim Neutkens Committed by GitHub

Add regenerator path (#30786)

parent e79f788f
......@@ -70,6 +70,9 @@ function getSWCOptions({
},
},
},
regenerator: {
importPath: require.resolve('regenerator-runtime'),
},
},
}
......
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>
}
......@@ -8,7 +8,14 @@ const packagesDir = path.join(__dirname, '..', '..', '..', '..', 'packages')
const appDir = path.join(__dirname, '..', 'app')
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) {
const folder = path.join(os.tmpdir(), Math.random().toString(36).substring(2))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment