Files
test-repo/tests/integration/env.js
T

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

20 lines
647 B
JavaScript
Raw Normal View History

import path from "node:path";
import createEsmUtils from "esm-utils";
const { __dirname, require } = createEsmUtils(import.meta);
2020-01-15 22:55:08 +08:00
const isProduction = process.env.NODE_ENV === "production";
const { PRETTIER_DIR } = process.env;
const { bin } = require(path.join(PRETTIER_DIR, "package.json"));
2020-01-15 22:55:08 +08:00
const prettierCli = path.join(
PRETTIER_DIR,
2020-01-15 22:55:08 +08:00
typeof bin === "object" ? bin.prettier : bin,
);
2023-12-05 14:39:11 +08:00
const prettierMainEntry = isProduction
? path.join(PRETTIER_DIR, "./index.mjs")
: path.join(PRETTIER_DIR, "./src/index.js");
2020-01-15 22:55:08 +08:00
const projectRoot = path.join(__dirname, "../..");
export { isProduction, prettierCli, prettierMainEntry, projectRoot };