Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: support yarn PnP out of box, propagate PnP runtime #98

Merged
merged 8 commits into from Aug 10, 2022
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
13 changes: 13 additions & 0 deletions src/index.ts
Expand Up @@ -42,6 +42,7 @@ const {
SYNCKIT_TIMEOUT,
SYNCKIT_EXEC_ARGV,
SYNCKIT_TS_RUNNER,
NODE_OPTIONS,
} = process.env

export const DEFAULT_BUFFER_SIZE = SYNCKIT_BUFFER_SIZE
Expand Down Expand Up @@ -209,6 +210,18 @@ const setupTsRunner = (
}
}

if (process.versions.pnp) {
try {
const resolvedPnp = require.resolve('pnpapi')
JounQin marked this conversation as resolved.
Show resolved Hide resolved
if (
!NODE_OPTIONS?.includes(resolvedPnp) &&
noahnu marked this conversation as resolved.
Show resolved Hide resolved
!execArgv.includes(resolvedPnp)
) {
execArgv.push('-r', resolvedPnp)
}
} catch {}
JounQin marked this conversation as resolved.
Show resolved Hide resolved
}

return {
ext,
isTs,
Expand Down