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

Exclude a folder from files to be checked/watched #1316

Closed
diessica opened this issue Jun 6, 2015 · 3 comments
Closed

Exclude a folder from files to be checked/watched #1316

diessica opened this issue Jun 6, 2015 · 3 comments
Milestone

Comments

@diessica
Copy link

diessica commented Jun 6, 2015

hexo server command was taking too much to execute in terminal, then I added the --debug flag and have found out that Hexo is actually looking for changes in some folders unnecessarily. I want to exclude them from the files to be checked when I hexo server - folders just like node_modules:

[...]
03:53:33.612 DEBUG Unchanged: themes/[...]/node_modules/[...]
03:53:33.612 DEBUG Unchanged: themes/[...]/node_modules/file[...]
03:53:33.612 DEBUG Unchanged: themes/[...]/node_modules/file3[...]
03:53:34.097 DEBUG Theme config loaded.
03:53:34.097 DEBUG Processed: _config.yml
[...]

Is there a setting for ignoring folders? I was thinking about skip_render or exclude_generator, but those didn't work. I guess the documentation wasn't that clear about their roles.

Thank you!

@diessica
Copy link
Author

diessica commented Jun 9, 2015

TL;DR
Hexo is watching files I don't want it to watch. How can I ignore those folders in my blog folder?

@diessica diessica changed the title Exclude a folder from files to be checked (when I type 'hexo server') Exclude a folder from files to be checked/watched Jun 9, 2015
@Xuanwo
Copy link
Contributor

Xuanwo commented Jun 9, 2015

#1146 (comment)

Will this be useful?

@Cobertos
Copy link

Cobertos commented Jan 10, 2019

Got here from Google considering this is an undocumented feature and non-trivial.

I think this feature was added in #2631 from issue #2632. This adds a global ignore: parameter to exclude folders from watching/processing, but I could only get it to work from the projects config and not the theme config (though you can still ignore theme files).

Adding the following property to your _config.yml will stop it from watching/processing these files during generation or serving (in this example, the themes node_modules folder). It uses minimatch globs.

ignore: ['**/themes/**/node_modules/**', '**/themes/**/node_modules', '**/themes/**/.git', '**/themes/**/.git/**']

The actual implementation site can be found in box.js

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants