Ignore node_modules folders
See original GitHub issueFor the context: I want to use a combination of lerna and fractal, each fractal component being a npm package handled by lerna. This means that each component can have dependencies to other components or external libraries and can have a node_modules
folder.
On the other hand, I don’t want those node_modules
folders to appear in my style guide, that’s why I’d need fractal to ignore them.
Digging in the source, I found out that it can be done quite easily by changing src/core/fs.js (line 118) by:
if (recursive && statCache.isDirectory() && Path.basename(filePath) != 'node_modules') {
That’s all it takes to ignore node_modules
folders.
Issue Analytics
- State:
- Created 7 years ago
- Comments:10 (2 by maintainers)
Top Results From Across the Web
node modules - Git - Ignore node_modules folder everywhere
Open sourcetree; click particular project; click settings; click Advanced; click Edit gitignore; Write "node_modules"; And Save.
Read more >Exclude node_modules Folder from Git using .gitignore
The best way to exclude a folder from Git is to add a .gitignore file to the root of the project. This file...
Read more >How to ignore the node_modules folder in Git? - Tim Mousk
To ignore the node_modules folder, you must create a .gitignore file. Then write the folder name to ignore it. ... Sometimes, however, a...
Read more >Git ignore node modules - Simple Solution and Common ...
Git ignore node modules - Simple Solution and Common Gotchas ... It will match the node_modules directory anywhere in your git repository.
Read more >gitignore node_modules - Linux Hint
The node_modules folder is a folder that contains all the packages installed and required by your JavaScript project. Although the node_modules folder is ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@sbaechler thanks for your suggestion but the problem I’m trying to solve is a bit different than yours. My goal is to be able to ignore nested components.
Let’s say I have 2 components named
component-a
andcomponent-b
and the following folder structure:Now let’s say that
component-b
depends oncomponent-a
. Incomponent-b
’spackage.json
, I will have something like:Since I use lerna to manage my monorepo, when I run
lerna bootstrap
I’ll get:And fractal will display the nested
component-a
. This is what I want to avoid.This has been implemented in #572