-
Notifications
You must be signed in to change notification settings - Fork 60
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Problems with project-relative paths #149
Comments
I have to add the root dir/project folder as include path, too as workaround to get around this error. Also, root option must be either omitted for its default value or |
This is a "bug" in gulp-sass. See dlmanning/gulp-sass#474 for more context. gulp-sass (incorrectly) auto-magically adds the file's parent directory onto the |
Wouldn't it make sense to add the root path to includePaths so all files in root can be imported correctly? |
This isn't how Sass/node-sass behaves by default, so we do not want to make this the default behavior in eyeglass. Here's an example using var sass = require("node-sass");
var path = require("path");
sass.render({
file: path.join(__dirname, "scss", "styles.scss")
}, function(error, result) {
if (error) {
console.error(error);
}
else {
console.log(result.css.toString());
}
}); You'll notice that it throws a similar error:
👍Happy to take a PR. |
To what section in README this notice about adding the project folder to includePaths would belong? |
Using plain node-sass (gulp-sass), it is possible to specify project-relative paths:
Gulpfile.js:
./scss/styles.scss:
./scss/dir1/_file1.scss
./scss/dir2/_file2.scss:
With ./scss being the topmost folder, import paths are correctly resolved.
./css/styles.css:
When eyeglass is also used, these project-relative paths aren't relative to project-folder anymore:
Sample project for reproducing this issue.
Edit: Using the eyeglass root option (e.g.
root: __dirname
orroot: __dirname + '/scss'
) doesn't seem to change the way how these paths are interpreted.The text was updated successfully, but these errors were encountered: