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

modify entrypoints.ts to handle wildcards in package.json export node… #3890

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 11 additions & 1 deletion esinstall/src/entrypoints.ts
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,17 @@ function* forEachWildcardEntry(
let valueDirectoryFullPath = path.join(cwd, valueDirectoryName);

if (existsSync(valueDirectoryFullPath)) {
let filesInDirectory = readdirSync(valueDirectoryFullPath).filter(
let directoryContents = readdirSync(valueDirectoryFullPath);
let directoriesInDirectory = directoryContents.filter(
(filepath) => statSync(path.join(valueDirectoryFullPath, filepath)).isDirectory(), // ignore directories
);

for (let directoryname of directoriesInDirectory) {
const nextdir = `${valueDirectoryName}/${directoryname}/*`;
yield * forEachWildcardEntry(nextdir, nextdir, cwd);
}

let filesInDirectory = directoryContents.filter(
(filepath) => statSync(path.join(valueDirectoryFullPath, filepath)).isFile(), // ignore directories
);

Expand Down