Skip to content

About

ParcelJS plugin for a better integration with pnpm.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

4 stars

Watchers

1 watching

Forks

Latest commit

 

History

2 Commits

Folders and files

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

Code of conduct

Contributing

Security policy

Stars

4 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages