Skip to content

guesant/parcel-resolver-pnpm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

parcel-resolver-pnpm

About

ParcelJS considers all dependencies that are symbolic links as "source dependencies" and then takes special treatment. However, for the PNPM package manager each installed package is a symbolic link to the packages stored in the store. Learn more in this issue.

The purpose of this plugin is to improve the integration between the PNPM and ParcelJS.

Usage

pnpm i parcel-resolver-pnpm

Partial .parcelrc file:

{
  "resolvers": [
    "parcel-resolver-pnpm",
    "..."
  ]
}

This Proof-Of-Concept solution is based on this comment.

src/PNPMResolver.ts (based on DefaultResolver):

+ resolver.processPackage = async function (pkg: any, file: string, dir: string) {
+   await NodeResolver.prototype.processPackage.call(this, pkg, file, dir)
+   if (pkg.source) {
+     const realpath = await this.fs.realpath(file)
+     if (realpath.includes("node_modules/.pnpm")) {
+       delete pkg.source
+     }
+   }
+ }

References:

License

MIT

About

ParcelJS plugin for a better integration with pnpm.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published