Socket
Socket
Sign inDemoInstall

gulp-belongs-to

Package Overview
Dependencies
56
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    gulp-belongs-to

plugin for adding parents of included files to stream


Version published
Maintainers
1
Install size
757 kB
Created

Readme

Source

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 may be used with built in watch or with gulp-watch.

mixins/headers.scss

// belongs_to ../main.scss

h1 {
  font-size: 2em;
}

main.scss

@import "mixins/headers";

body {
  margin: 0;
}

Gulpfile

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

Keywords

FAQs

Last updated on 25 Oct 2014

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc