fix issues
This commit is contained in:
parent
835efb31b9
commit
6a406db60a
23 changed files with 295 additions and 118 deletions
14
.yarn/sdks/prettier/index.js
vendored
14
.yarn/sdks/prettier/index.js
vendored
|
@ -2,9 +2,9 @@
|
|||
|
||||
const {existsSync} = require(`fs`);
|
||||
const {createRequire, createRequireFromPath} = require(`module`);
|
||||
const {resolve, dirname} = require(`path`);
|
||||
const {resolve} = require(`path`);
|
||||
|
||||
const relPnpApiPath = "../../../.pnp.js";
|
||||
const relPnpApiPath = "../../../.pnp.cjs";
|
||||
|
||||
const absPnpApiPath = resolve(__dirname, relPnpApiPath);
|
||||
const absRequire = (createRequire || createRequireFromPath)(absPnpApiPath);
|
||||
|
@ -14,16 +14,6 @@ if (existsSync(absPnpApiPath)) {
|
|||
// Setup the environment to be able to require prettier/index.js
|
||||
require(absPnpApiPath).setup();
|
||||
}
|
||||
|
||||
const pnpifyResolution = require.resolve(`@yarnpkg/pnpify`, {paths: [dirname(absPnpApiPath)]});
|
||||
if (typeof global[`__yarnpkg_sdk_is_using_pnpify__`] === `undefined`) {
|
||||
Object.defineProperty(global, `__yarnpkg_sdk_is_using_pnpify__`, {configurable: true, value: true});
|
||||
|
||||
process.env.NODE_OPTIONS += ` -r ${pnpifyResolution}`;
|
||||
|
||||
// Apply PnPify to the current process
|
||||
absRequire(pnpifyResolution).patchFs();
|
||||
}
|
||||
}
|
||||
|
||||
// Defer to the real prettier/index.js your application uses
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue