Skip to content
This repository has been archived by the owner on Jul 24, 2022. It is now read-only.

Assets cleaner feature #44

Open
BusinessDuck opened this issue Dec 15, 2018 · 0 comments
Open

Assets cleaner feature #44

BusinessDuck opened this issue Dec 15, 2018 · 0 comments

Comments

@BusinessDuck
Copy link

This is a feature request.

  1. Some times may be useful to clean empty assets. For example it's may be created by scss (sass) compilation. Or any other hexo plugins may create temp files and doesn't remove it after working. Empty files may be detected by buffer.toString().length === 0 or buffer.length === 0.
  2. Some hexo plugin may produce not empty temporary files or big project may contains unused files, images or legacy script, u know. For large project we cant clean it manually and keep project clean. Concept of this feature looks like: Create a db, and loop each text buffer file and save all used files to map. Then iterate hexo routes and remove all files which one does not exists in map of all used files.

lets create cleaner.js filter with config

cleaner:
  enabled: true
  empty: true
  unused: true
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant