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

fix(config): set 'ignore' to ignores some files #30

Closed
wants to merge 1 commit into from

Conversation

dailyrandomphoto
Copy link
Member

@dailyrandomphoto dailyrandomphoto commented Dec 5, 2019

Related: #25 , hexojs/hexo#3904 , hexojs/site#1195

Set default value for ignore.

ignore:
  # ignore themes/xxx/node_modules/
  - "**/node_modules/**"
  # ignore themes/xxx/.git/ and other hidden files
  - "**/.*"

This value is useful when you git clone a theme repo to /themes/ .

@SukkaW
Copy link
Member

SukkaW commented Dec 5, 2019

Hidden files and theme/**/node_modules are already ignored when processing themes, see: https://github.com/hexojs/hexo/blob/b6394c78751d2be81c3fd7c243fca37c552cd83a/lib/theme/processors/source.js#L31

@dailyrandomphoto
Copy link
Member Author

Hidden files and theme/**/node_modules are already ignored when processing themes, see: https://github.com/hexojs/hexo/blob/b6394c78751d2be81c3fd7c243fca37c552cd83a/lib/theme/processors/source.js#L31

Yes, they are ignored when processing themes.

However these files are included in model('Cache'). (see this db.json.txt )

If there are many files under node_modules/, it will slow down hexo and uses a lot of memory.
This even causes this error.

Error: ENOMEM: not enough memory, open '/home/dev/test-rollback/themes/landscape/node_modules/rxjs/operator/exhaust.js'

@dailyrandomphoto
Copy link
Member Author

I think it's better to handle this in lib/box/index.js instead of _config.yml on hexo@4.1 and later.

@curbengh
Copy link
Contributor

curbengh commented Dec 6, 2019

I think it's better to handle this in lib/box/index.js instead of _config.yml on hexo@4.1 and later.

I agree, I plan to add **/themes/*/node_modules/** into lib/box, so that it's always ignored regardless of _config.yml (user might accidentally reset the ignore: config).

It will be part of >=4.1.1 (4.1.0 is getting long in the tooth).

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

Successfully merging this pull request may close these issues.

3 participants