Add node_modules directory to ignored list of files and directories. #776
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation
In a recent project I was working on, I customized the theme that FSDocs operate on. The customized theme was first processed with NPM, then template files were fed to FSDocs to use. So as a general highlight of the pipeline:
npm install
to install node dependencies,npm run build
to generate the final build output from NPM, this includes final template HTML files as well as styling and JavaScript files,dotnet fsdocs
to generate the site and API documentation.One issue that results from this flow is that we have
node_modules
directory that resulted fromnpm install
and is needed innpm run build
. That directory got processed by FSDocs when it runs. Hence we get in output anode_modules
directory with thousands of files! In addition, the run time for FSDocs has doubled.The workaround I did was to rename the
node_modules
directory to.node_modules
before running step number 3 above. Since FSDocs ignore files and directories that start with a dot. Once FSDocs is done, I rename it back tonode_modules
.The issue with this approach is that, during development, we need to run FSDocs and NPM both in watch modes, but we cannot, since
node_modules
directory has been renamed, hence NPM cannot be run. So we run either of them.The Change
This PR adds an ignore list-like function that has the
node_modules
directory and "." criteria. In which it will ignore either of them. Also, I updated the documentation page to highlight this in the Ignored Content section.