How to specify a dependency for hexo

231 views Asked by At

I am trying to migrate my jekyll theme to hexo. In that theme I use gulp and a series of dependencies, for example kouto-swiss. Now, I've created a bare-bone blog in hexo and place my jekyll css files in the css folder for the hexo theme.

When I try to build the site using the theme I get the error:

Error: /home/hkr/Desarrollo/blog/themes/cards/source/css/main.styl:21:9
   21| @import "kouto-swiss"
---------------^

I've tried to add "kouto-swiss" as a dependency of the hexo blog, like this:

{
  "name": "hexo-site",
  "version": "0.0.0",
  "private": true,
  "hexo": {
    "version": "3.2.2"
  },
  "dependencies": {
    "gulp": "^3.9.1",
    "hexo": "^3.2.0",
    "hexo-generator-archive": "^0.1.4",
    "hexo-generator-category": "^0.1.3",
    "hexo-generator-index": "^0.2.0",
    "hexo-generator-tag": "^0.2.0",
    "hexo-renderer-ejs": "^0.2.0",
    "hexo-renderer-marked": "^0.2.10",
    "hexo-renderer-stylus": "^0.3.1",
    "hexo-server": "^0.2.0",
    "kouto-swiss": "^1.0.0" <<-- Tried as dependency
  },
  "devDependencies": {
    "del": "^2.2.2",
    "gulp-clean-css": "^2.3.2",
    "gulp-htmlclean": "^2.7.8",
    "gulp-htmlmin": "^3.0.0",
    "gulp-imagemin": "^3.1.1",
    "gulp-uglify": "^2.0.0",
    "hexo": "^3.2.2",
    "kouto-swiss": "^1.0.0", <<-- And a dev dependency
    "run-sequence": "^1.2.2"
  }
}

But I can't get hexo clean && hexo generate to work, I keep getting: failed to locate @import file kouto-swiss.styl

Could someone tell me what I am doing wrong?

Regards

NOTE

I can resolve this error writting:

@import "../../../../node_modules/kouto-swiss"

But I do not think this is the correct way of doing it. Is there a way of simply writing @import "kouto-swiss"?

0

There are 0 answers