Change pattern for telling if linked

This commit is contained in:
Joseph Garrone 2024-11-18 04:51:14 +01:00
parent d4ac67dba8
commit e0cda43724

View File

@ -50,7 +50,7 @@ export async function getPrettier(): Promise<PrettierAndConfigHash> {
// of prettier, that is the one of the project, not the one of this repo. // of prettier, that is the one of the project, not the one of this repo.
// So we do a sketchy eval to bypass ncc. // So we do a sketchy eval to bypass ncc.
// We make sure to only do that when linking, otherwise we import properly. // We make sure to only do that when linking, otherwise we import properly.
if (readThisNpmPackageVersion() === "0.0.0") { if (readThisNpmPackageVersion().startsWith("0.0.0")) {
eval( eval(
`${symToStr({ prettier })} = require("${pathResolve(pathJoin(getNodeModulesBinDirPath(), "..", "prettier"))}")` `${symToStr({ prettier })} = require("${pathResolve(pathJoin(getNodeModulesBinDirPath(), "..", "prettier"))}")`
); );