WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Conversation

@sagrimson
Copy link

@sagrimson sagrimson commented Mar 10, 2022

… recursively

Changes

This PR addresses the issue described here: #3867
The current function only returns paths to modules that are in the top level of the directory, but it should return all files in the subdirectories according to this: https://nodejs.org/api/packages.html#subpath-patterns. To fix this, I modified the function forEachWildcardEntry() to yield files in subdirectories.

Testing

I tested this in my local environment and can now import modules that are in subdirectories of wildcard entries of the export field of the package.json

Docs

@changeset-bot
Copy link

changeset-bot bot commented Mar 10, 2022

⚠️ No Changeset found

Latest commit: 0681b9a

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@vercel
Copy link

vercel bot commented Mar 10, 2022

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/pikapkg/snowpack/9qj5VxXxSAkv9wBjjiTn8Ej1D6ik
✅ Preview: https://snowpack-git-fork-sagrimson-esinstallexportfix-pikapkg.vercel.app

@vvaradarajan
Copy link

vvaradarajan commented Apr 12, 2024

Great work..Has this been released? I downloaded [snowpack] 3.8.8, and found that files in the 'subdirectories' were not being 'exported'. My use-case is the @Shoelace components. The issue is:
./node_modules/@shoelace-style/shoelace/package.json ## location of package.json
..
"./dist/components/*": "./dist/components/*" ## Line in exports section. However this line was not sufficient to export './dist/components/carousel/carousel.js'
Adding the line below to explicitly import from the subdirectory (carousel) works..
"./dist/components/carousel/*": "./dist/components/carousel/*"

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

Successfully merging this pull request may close these issues.

2 participants