https://github.com/daun/modern-sass-glob-importer
https://github.com/daun/modern-sass-glob-importer
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/daun/modern-sass-glob-importer
- Owner: daun
- License: mit
- Created: 2025-06-15T14:23:27.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-06-15T14:35:35.000Z (about 1 year ago)
- Last Synced: 2025-06-15T14:37:47.466Z (about 1 year ago)
- Language: JavaScript
- Size: 0 Bytes
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Modern Sass Glob Importer
[](https://www.npmjs.com/package/modern-sass-glob-importer)
[](https://opensource.org/licenses/MIT)
A custom importer for Sass that expands glob patterns.
```scss
@use "components/**/*.scss";
@use "elements/**/*.scss";
```
## Description
While there are a number of Sass glob importers available, none of them currently work with the [modern JS API](https://sass-lang.com/documentation/breaking-changes/legacy-js-api/) or support `@use` statements. This importer only works with the modern API and has no intention of working with the legacy API.
## Features
- Expands `*.glob` patterns to their matching files
- Imports from both `@use` and `@import` statements
- Supports nested imports
- Works with vite, webpack, etc, or standalone
## Installation
```bash
npm install modern-sass-glob-importer
```
## Usage
```js
const sass = require("sass");
const globImporter = require("modern-sass-glob-importer");
// Standalone usage
sass
.compile("path/to/style.scss", {
importers: [globImporter()],
})
.then(function (result) { });
```
## Example
```scss
@use "components/*.scss";
@use "elements/*.scss";
```
## License
MIT