Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plugin ignores package.json exports field #40

Open
a-churchill opened this issue Aug 4, 2021 · 1 comment
Open

Plugin ignores package.json exports field #40

a-churchill opened this issue Aug 4, 2021 · 1 comment

Comments

@a-churchill
Copy link

Over in the main berry repo, support for the package.json exports field was added in this PR, here in the code. However, this code is not called by the plugin, which calls findPackageLocator directly, here:

const moduleLocator = pnpapi.findPackageLocator(moduleLocation);

This breaks my monorepo setup, which uses an exports field in a package like this:

  "exports": {
    "./*": "./build/*"
  },

I'm not familiar with the intricacies of the PnP api, but would it be possible to call resolveRequest instead, which (if I'm reading the source correctly) would call applyNodeExportsResolution eventually, instead of findPackageLocator which does not?

@merceyz
Copy link

merceyz commented Sep 17, 2021

exports support was added to webpack / enhanced-resolve v5 which also has PnP support built-in, this plugin is for Webpack 4.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants