hexo-cli icon indicating copy to clipboard operation
hexo-cli copied to clipboard

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

Open sunbohong opened this issue 4 years ago • 3 comments

{
  "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

sunbohong avatar Oct 04 '20 06:10 sunbohong

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

fnick851 avatar Feb 19 '21 05:02 fnick851

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 ?

tomap avatar Feb 21 '21 17:02 tomap

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.

fnick851 avatar Jun 16 '21 05:06 fnick851