From c149410ad1d90d741301bb0e93a07bd6c9eb8482 Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Tue, 29 Jan 2019 07:03:49 -0800 Subject: [PATCH] fix(pnp): make sure pnp module is again the first preloaded module. (#6951) * fix(pnp): make sure pnp module is again the first preloaded module. * Update CHANGELOG.md --- CHANGELOG.md | 4 ++++ src/util/execute-lifecycle-script.js | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5287a8ae5b..1c1fb6a220 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,10 @@ Please add one entry in this file for each change in Yarn's behavior. Use the sa ## Master +- Changes the location where the `--require ./.pnp.js` flag gets added into `NODE_OPTIONS`: now at the front (bis) + + [#6951](https://github.com/yarnpkg/yarn/pull/6951) - [**John-David Dalton**](https://twitter.com/jdalton) + ## 1.14.0 - Improves PnP compatibility with Node 6 diff --git a/src/util/execute-lifecycle-script.js b/src/util/execute-lifecycle-script.js index aae9a2d09d..48b2051ae4 100644 --- a/src/util/execute-lifecycle-script.js +++ b/src/util/execute-lifecycle-script.js @@ -236,7 +236,7 @@ export async function makeEnv( // Note that NODE_OPTIONS doesn't support any style of quoting its arguments at the moment // For this reason, it won't work if the user has a space inside its $PATH env.NODE_OPTIONS = env.NODE_OPTIONS || ''; - env.NODE_OPTIONS += ` --require ${pnpFile}`; + env.NODE_OPTIONS = `--require ${pnpFile} ${env.NODE_OPTIONS}`; } pathParts.unshift(await getWrappersFolder(config));