hexojs / hexo

A fast, simple & powerful blog framework, powered by Node.js.
https://hexo.io
MIT License
39.57k stars 4.86k forks source link

Theme apply process optimization #5467

Open github3C opened 7 months ago

github3C commented 7 months ago

Check List

Feature Request

Recently, I tried installing several themes and encountered an issue when applying a theme: many themes insist on removing certain plugins and using others as replacements.

I noticed that the package.json file essentially lists all modules required by Hexo plus those needed for the theme. Is it possible to include related package dependencies directly within the theme file, along with the packages that need to be confirmed for removal? Ultimately, could we use a Hexo command to handle all these dependencies with one click?

Others

No response

uiolee commented 7 months ago

Personally, this is definitely not a good idea. Node's package manager is already complex and powerful enough. If hexo encapsulates it again, it will only make things more complicated. If there's a problem with a dependency, it's harder to troubleshoot.



Now Hexo provides a way to install themes via npm. If themes' developers wish, they can publish npm packages and include the dependencies they need. However, some conflicting plugins still need to be uninstalled manually.