Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
async resolveEntry(entry: FilePath): Promise {
if (isGlob(entry)) {
let files = await glob(entry, this.fs, {
absolute: true,
onlyFiles: false,
});
let results = await Promise.all(files.map(f => this.resolveEntry(f)));
return results.reduce(
(p, res) => ({
entries: p.entries.concat(res.entries),
files: p.files.concat(res.files),
}),
{entries: [], files: []},
);
}
let stat;
try {
stat = await this.fs.stat(entry);
visitImport(imported) {
let importedPath = imported.path.first.string;
if (!deps.has(importedPath)) {
if (isGlob(importedPath)) {
deps.set(
importedPath,
glob(
path.resolve(path.dirname(filepath), importedPath),
parcelOptions.inputFS,
{
onlyFiles: true,
},
).then(entries =>
Promise.all(
entries.map(entry =>
resolve(
filepath,
'./' + path.relative(path.dirname(filepath), entry),
),
),
),
),
);