hexojs / hexo-cli

Command line interface for Hexo
MIT License
174 stars 79 forks source link

When we remove hexo in package.json,the generate(or any other command) action won't work #249

Open sunbohong opened 3 years ago

sunbohong commented 3 years ago
{
  "name": "hexo-site",
  "version": "0.0.0",
  "private": true,
  "scripts": {
    "build": "hexo generate",
    "clean": "hexo clean",
    "deploy": "hexo deploy",
    "server": "hexo server"
  },
//  "hexo": {
//    "version": "5.2.0"
//  },
  "dependencies": {
    "hexo": "^5.0.0",
    "hexo-generator-archive": "^1.0.0",
    "hexo-generator-category": "^1.0.0",
    "hexo-generator-index": "^2.0.0",
    "hexo-generator-tag": "^1.0.0",
    "hexo-renderer-ejs": "^1.0.0",
    "hexo-renderer-marked": "^3.0.0",
    "hexo-renderer-stylus": "^2.0.0",
    "hexo-server": "^2.0.0"
  }
}

image

fnick851 commented 3 years ago

I wonder how is this hexo field being used internally? Why is it required? Thanks.

tomap commented 3 years ago

It is not, or maybe just to obtain the hexo version

It's here to ensure that we are in an hexo site folder, with all the expected folders available Theme, sources, config yml,

But indeed, we could test for the files that are required and not test for this field.

Am I wrong @hexojs/core ?

fnick851 commented 3 years ago

I think the hexo field is required - at least when deploying to Vercel. Vercel will fail the build if it is omitted, though I don't know what it is for exactly.