|
| 1 | +## Sass Import graph resolver |
1 | 2 |
|
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 |
5 | 4 |
|
| 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. |
6 | 6 |
|
7 | 7 | ## Install |
8 | 8 |
|
9 | 9 | Install with [npm](https://npmjs.org/package/gulp-sass-graph) |
10 | 10 |
|
11 | 11 | ``` |
12 | | -npm install --save-dev gulp-sass-graph |
| 12 | +npm install --save-dev maxmx/gulp-sass-graph |
13 | 13 | ``` |
14 | 14 |
|
15 | 15 |
|
16 | 16 | ## Example |
17 | 17 |
|
| 18 | +The included paths must be an array of absolute paths. |
| 19 | +Make sure to also include absolute paths to your libraries. |
| 20 | + |
18 | 21 | ```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 | + |
19 | 27 | 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')); |
26 | 32 | }); |
27 | 33 | ``` |
28 | 34 |
|
|
0 commit comments