Skip to content

Commit 5029a8b

Browse files
committed
Example update
1 parent 105d03c commit 5029a8b

File tree

1 file changed

+16
-10
lines changed

1 file changed

+16
-10
lines changed

readme.md

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,34 @@
1+
## Sass Import graph resolver
12

2-
> Read the import graph from passed sass files to work with dependencies
3-
4-
Only pass along Sass files that have changed, along with dependencies.
3+
Partials piped in the stream will resolve their parents and push then downstream to get compiled by Sass
54

5+
###### Note: This is a working, absolute paths only, version of [gulp-sass-graph](https://github.com/lox/gulp-sass-graph) which is no longer maintained.
66

77
## Install
88

99
Install with [npm](https://npmjs.org/package/gulp-sass-graph)
1010

1111
```
12-
npm install --save-dev gulp-sass-graph
12+
npm install --save-dev maxmx/gulp-sass-graph
1313
```
1414

1515

1616
## Example
1717

18+
The included paths must be an array of absolute paths.
19+
Make sure to also include absolute paths to your libraries.
20+
1821
```js
22+
23+
var cssResources = [path.join(__dirname, 'src/css')],
24+
bourbonResources = bourbon.includePaths, // Array of paths from bourbon.
25+
paths = cssResources.concat(bourbonResources);
26+
1927
gulp.task('watch-sass', function(cb) {
20-
return watch({glob:'resources/assets/css/**/*.scss', emitOnGlob: false, name: "Sass"})
21-
.pipe(sassGraph(sassLoadPaths))
22-
.pipe(sass({loadPath: sassLoadPaths}))
23-
.pipe(notify('Sass compiled <%= file.relative %>'))
24-
.pipe(gulp.dest('web/dist/css'))
25-
.pipe(livereload());
28+
return watch('src/css/**/*.scss')
29+
.pipe(sassGraph(paths))
30+
.pipe(sass({includePaths: paths}))
31+
.pipe(gulp.dest('dist/css'));
2632
});
2733
```
2834

0 commit comments

Comments
 (0)