2023-06-18 03:57:02 +00:00
|
|
|
#!/usr/bin/env node
|
|
|
|
|
|
|
|
const {existsSync} = require(`fs`);
|
|
|
|
const {createRequire} = require(`module`);
|
|
|
|
const {resolve} = require(`path`);
|
|
|
|
|
|
|
|
const relPnpApiPath = "../../../.pnp.cjs";
|
|
|
|
|
|
|
|
const absPnpApiPath = resolve(__dirname, relPnpApiPath);
|
|
|
|
const absRequire = createRequire(absPnpApiPath);
|
|
|
|
|
|
|
|
if (existsSync(absPnpApiPath)) {
|
|
|
|
if (!process.versions.pnp) {
|
2023-09-23 03:51:15 +00:00
|
|
|
// Setup the environment to be able to require prettier
|
2023-06-18 03:57:02 +00:00
|
|
|
require(absPnpApiPath).setup();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-09-23 03:51:15 +00:00
|
|
|
// Defer to the real prettier your application uses
|
|
|
|
module.exports = absRequire(`prettier`);
|