knksmith57 / hexo-renderer-sass

Sass renderer plugin for Hexo
47 stars 45 forks source link

relative path in import #37

Closed TrejGun closed 6 years ago

TrejGun commented 7 years ago

hi there! i have found a problem in loading scss files from node_modules

css files are fine

@import "~normalize.css";
@import "~normalize.css/normalize.css";

but scss files are not loading

@import "~bootstrap";
@import "~bootstrap/scss/bootstrap.scss";

i tried to add node-sass config

node_sass:
  includePaths:
   - node_modules

and it fixes imports from submodules

@import "bootstrap/scss/bootstrap.scss";

but "~" symbol still doesn't work how can i configure this to work same as in sass-loader?

JLHwung commented 7 years ago

The tilde syntax is not a feature of node-sass but webpack. See https://github.com/webpack-contrib/css-loader/issues/12#issuecomment-41940311.

You can give https://www.npmjs.com/package/node-sass-tilde-importer a try but I never used this importer before.

TrejGun commented 7 years ago

works like magic, thanks