npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

gulp-glob-sass

v1.0.3

Published

The gulpSassGlob plugin simplifies working with SASS/SCSS files by automatically replacing @import, @use, and @forward constructs using templates with an actual list of matching files. This helps automate and simplify the inclusion of style files in proje

Readme

Guide to Using the gulpGlobSass Plugin

The plugin simplifies working with SASS/SCSS files by automatically replacing @import, @use, and @forward constructions that use glob patterns with an actual list of matching files. This helps automate and streamline the process of including style files in projects. Based on gulp-sass-glob plugin. Added support for @use and @forward. Added base directory setting.


Installation

  1. Download the plugin.
  2. Install the required dependencies (It will be automatic):
npm install gulp-glob-sass -D
  1. Include the plugin in your project.

Usage

  1. Import the plugin:
const gulpGlobSass = require('gulp-glob-sass');
  1. Example Gulp task:
const gulp = require('gulp');
const gulpGlobSass = require('gulp-glob-sass');
const sass = require('gulp-sass')(require('sass')); // Example with Gulp Sass

gulp.task('styles', () => {
  return gulp.src('src/**/*.scss') // Path to SASS/SCSS files
    .pipe(gulpGlobSass({
      baseDir: __dirname,            // Base directory (default is process.cwd())
      includePaths: ['src/styles'],  // Paths to search for files
      ignorePaths: ['**/_ignore.scss'] // Ignored files
    }))
    .pipe(sass()) // Compile SCSS to CSS
    .pipe(gulp.dest('dist')); // Output folder
});

Configuration

You can customize the plugin's behavior by passing a configuration object to gulpSassGlob.

Available Options:

  • baseDir (string, default is process.cwd()):

    • Specifies the base directory for file searches.
    • Example: baseDir: __dirname.
  • includePaths (array of strings, default is empty):

    • Additional paths to search for files.
    • Example: includePaths: ['src/styles', 'node_modules'].
  • ignorePaths (array of strings, default is empty):

    • Paths or file patterns to ignore.
    • Example: ignorePaths: ['**/_ignore.scss', '**/temp/*.scss'].

Examples

Example 1: Automatic File Inclusion

If the main.scss file contains the line:

@use "components/*";

The plugin will replace it with:

@use "components/button.scss";
@use "components/header.scss";
@use "components/footer.scss";

(The file list is generated automatically based on the contents of the components directory.)

Example 2: Ignoring Files

With the configuration:

ignorePaths: ['**/_ignore.scss']

Files matching the pattern will not be included in the import list.

Example 3: Working with SASS

If the file has a .sass extension, the plugin will generate lines without a semicolon:

@use "components/button"
@use "components/header"

Advantages

  1. Automation: Eliminates the need to manually list imported files.
  2. Glob Pattern Support: Flexible file inclusion using masks.
  3. Customizable: Allows ignoring specific files or specifying additional paths.
  4. Cross-Platform: Ensures correct path handling regardless of the OS.

Compatibility

The plugin is compatible with:

  • Gulp (version 4 and above).
  • Files with .scss and .sass extensions.

Possible Errors

  1. File Not Found:

    • Check the glob pattern for correctness.
    • Ensure the paths in includePaths are specified correctly.
  2. Incorrect Syntax:

    • Make sure .sass files do not use semicolons, and .scss files do.