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

vite-plugin-scss-bundler

v0.2.0

Published

A Vite plugin to bundle SCSS libraries into a single file. Supports both virtual serving and physical file writing.

Readme

SemVer Status

💡 Motivation

The motivation behind vite-plugin-scss-bundler is to create a unified SCSS bundle that can be easily utilized in various scenarios:

Previewing Content: Pass the bundled SCSS library to components or tools that require the complete stylesheet for rendering previews or managing styles dynamically. Extracting Information: Simplify the extraction of key information from the library, such as variables, colors, typography settings, and configuration values, to streamline workflows and enable advanced integrations.

🌟 Features

  • Full SCSS Support: Compatible with @import, @use, and @forward.
  • Dependency Resolution: Maintains the correct order of imports to ensure the correct cascade of styles.
  • Avoid Duplicates: Automatically skips duplicate imports.
  • Virtual Bundle Module: Provides a virtual SCSS bundle that can be imported directly into your project.
  • Output to File: Optionally save the bundle as a physical .scss file.
  • Watch Mode: Automatically rebuilds the bundle when changes are detected in the SCSS files.
  • Ignore Patterns: Supports regex patterns to exclude files from the bundle.
  • Customizable Virtual Module Name: Change the default name virtual:scss-bundle to suit your project.
  • Warnings & Errors: Displays clear warnings and stops execution on critical errors, ensuring reliability.

🚀Getting Started

Installation

npm install vite-plugin-scss-bundler

🛠️ Usage

In your vite.config.ts:

import { defineConfig } from "vite";
import scssBundlePlugin from "vite-plugin-scss-bundler";

export default defineConfig({
  plugins: [
    scssBundlePlugin({
      inputDir: "src/styles",
      entryFile: "main.scss",
      output: "dist/bundle.scss",
      watch: true,
      ignore: [/test\.scss$/, /_temp/],
      minify: true,
      silent: false,
    }),
  ],
});

Using the Virtual Bundle

The plugin provides a virtual module (virtual:scss-bundle by default) that allows you to include the SCSS bundle directly in your project without saving it to a file. Here's how to use it:

// Stylesheet file
@use "virtual:scss-bundle";
// TypeScript file
import libraryScss from "virtual:scss-bundle";

You can also customize the virtual module's name using the virtualName parameter in the plugin configuration.

For TypeScript projects, add the following declaration to avoid type errors in a virtual.d.ts file or any existing .d.ts file in your project:

declare module "virtual:scss-bundle" {
  const scss: string;
  export default scss;
}

This tells TypeScript what to expect when importing the virtual:scss-bundle module.

⚙️ Configuration

| Parameter | Type | Description | Default | | ------------- | -------- | ---------------------------------------------------------------------------- | ------------------- | | watchDir | string | Path to the directory to watch for changes library. | Required | | entryFile | string | Entry file for the SCSS bundle. | Required | | output | string | Path to save the bundled SCSS file (optional). | null (only virtual) | | ignoreImports | RegExp[] | Regex patterns to skip specified SCSS imports. | [] | | virtualName | string | Custom name for the virtual SCSS bundle module. | virtual:scss-bundle | | minify | boolean | Minifies the bundled SCSS code (without compiling to CSS). | false | | silent | boolean | Suppresses success, info, and warning messages. Errors will always be shown. | false |

🗺️ Roadmap

  • [] Add namespace support for @use and @forward.

🤝 Contributions

Explain how users can contribute to your library, typically:

Reporting bugs Fixing bugs Adding new features Sharing on social media Becoming an official contributor Making a small donation

📜 License

Indicating the type of license for your project helps others know what they can and cannot do with it. You can find templates for all types of licenses here: https://opensource.org/licenses. Choose wisely, as this will determine how others can use your library.

In my case, I am developing open-source code and using the MIT license, which allows users to do almost anything with the code.

🙌 Footer

This is the closing section of your README. You can be creative here: introduce yourself, thank users for their interest, or ask them to give the project a star.