Skip to content

Commit

Permalink
fix: cleanup loader when not using pnp and/or esm
Browse files Browse the repository at this point in the history
  • Loading branch information
merceyz committed Nov 29, 2020
1 parent 47c4984 commit 5ab066d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/plugin-pnp/sources/PnpLinker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -264,9 +264,13 @@ 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);
await xfs.removePromise(pnpPath.esmLoader);

return;
}
Expand Down

0 comments on commit 5ab066d

Please sign in to comment.