https://github.com/mykolaharmash/gulp-belongs-to
Gulp plugin for adding parent files of included partials into stream
https://github.com/mykolaharmash/gulp-belongs-to
Last synced: about 2 months ago
JSON representation
Gulp plugin for adding parent files of included partials into stream
- Host: GitHub
- URL: https://github.com/mykolaharmash/gulp-belongs-to
- Owner: mykolaharmash
- Created: 2014-10-25T21:54:31.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2014-10-26T13:17:56.000Z (almost 11 years ago)
- Last Synced: 2025-02-10T05:44:05.458Z (8 months ago)
- Language: JavaScript
- Size: 137 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
## Description
When editing partial asset (eg sass mixin, jade include, etc.) with watch running, desirable to recompile only direct parents of this partial. With this plugin you can explicitly specify files partials belongs to.
## Usage
Plugin works best with [gulp-watch](https://github.com/floatdrop/gulp-watch).
`mixins/_headers.scss`
```
// belongs_to ../main.scssh1 {
font-size: 2em;
}
````main.scss`
```
@import "mixins/headers";body {
margin: 0;
}
```__Gulpfile__
```js
var gulp = require('gulp'),
, sass = require("gulp-sass")
, watch = require("gulp-watch")
, belongs = require("gulp-belongs-to")
;
gulp.task("watch", function () {
watch("src/scss/**/*.scss", { verbose: true }, function (files) {
files
.pipe(belongs())
.pipe(sass())
.pipe(gulp.dest("build/css"));
});
});
```Now, with `gulp watch` running, when mixins/_headers.scss edited only main.scss will recompile.
You can specify multiple `belongs_to` directives.
```
// belongs_to ../main.scss
// belongs_to ../foo/bar.scss
```## Install
Run `npm install gulp-belongs-to`