I've got a Tree whose root is the project root dir.
I would like to apply a rule using forEach, which iterates through all the files in the tree. This works, but it's very slow since node_modules is also part of the tree.
How could I exclude that dir?
I tried:
const templateSource = apply(source(tree), [
filter(path => {
return !path.includes('node_modules');
}),
forEach((entry: FileEntry) => {
....
}
But this always fails:
Error: Path "/some/path/some.file" already exist.
I don't see any methods which could help me to branch off the tree or something like that. I need to apply the forEach to only part of the tree. What's the best way to achieve this?