From 1b86f68a19a22680e8045d0c03e759f2f2a4587e Mon Sep 17 00:00:00 2001 From: merceyz Date: Mon, 21 Dec 2020 02:16:03 +0100 Subject: [PATCH] chore(pnp): always enable the esm loader --- packages/plugin-pnp/sources/PnpLinker.ts | 3 --- packages/plugin-pnp/sources/index.ts | 12 ++---------- 2 files changed, 2 insertions(+), 13 deletions(-) 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),