Skip to content

Commit

Permalink
chore(pnp): always enable the esm loader
Browse files Browse the repository at this point in the history
  • Loading branch information
merceyz committed Dec 21, 2020
1 parent d6a4dd4 commit 1b86f68
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 13 deletions.
3 changes: 0 additions & 3 deletions packages/plugin-pnp/sources/PnpLinker.ts
Expand Up @@ -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);
Expand Down
12 changes: 2 additions & 10 deletions packages/plugin-pnp/sources/index.ts
Expand Up @@ -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),
Expand Down

0 comments on commit 1b86f68

Please sign in to comment.