diff --git a/packages/plugin-pnp/sources/PnpLinker.ts b/packages/plugin-pnp/sources/PnpLinker.ts index 6405d7d86664..ebddce02e66b 100644 --- a/packages/plugin-pnp/sources/PnpLinker.ts +++ b/packages/plugin-pnp/sources/PnpLinker.ts @@ -264,9 +264,6 @@ export class PnpInstaller implements Installer { await xfs.removePromise(pnpPath.other); - if (this.opts.project.topLevelWorkspace.manifest.type !== `module`) - await xfs.removePromise(pnpPath.esmLoader); - if (this.opts.project.configuration.get(`nodeLinker`) !== `pnp`) { await xfs.removePromise(pnpPath.main); await xfs.removePromise(pnpDataPath); diff --git a/packages/plugin-pnp/sources/index.ts b/packages/plugin-pnp/sources/index.ts index a38dccf658de..a7e65c0bd077 100644 --- a/packages/plugin-pnp/sources/index.ts +++ b/packages/plugin-pnp/sources/index.ts @@ -13,16 +13,8 @@ export {jsInstallUtils}; export {pnpUtils}; export const getPnpPath = (project: Project) => { - let mainFilename; - let otherFilename; - - if (project.topLevelWorkspace.manifest.type === `module`) { - mainFilename = `.pnp.cjs`; - otherFilename = `.pnp.js`; - } else { - mainFilename = `.pnp.js`; - otherFilename = `.pnp.cjs`; - } + const mainFilename = `.pnp.cjs`; + const otherFilename = `.pnp.js`; return { main: ppath.join(project.cwd, mainFilename as Filename),