4.0.0 • Published 9 months ago

vite-plugin-sass-glob-import v4.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
9 months ago

vite-plugin-sass-glob-import

Use glob syntax for @import or @use in your main Sass or SCSS file.

Install

npm i -D vite-plugin-sass-glob-import
// In vite.config.js

import { defineConfig } from 'vite'
import sassGlobImports from 'vite-plugin-sass-glob-import';

export default defineConfig({
  plugins: [
    sassGlobImports()
  ]
});

Usage

Note: Globbing only work in a top-level file, not within referenced files.

// In src/styles/main.scss

@use 'vars/**/*.scss';
@import 'utils/**/*.scss';
@import 'objects/**/*.scss';

The above will be transformed into something like the following before Vite processes it with Sass:

@use 'vars/var-a.scss';
@use 'vars/var-b.scss';
@import 'utils/utils-a.scss';
@import 'utils/utils-b.scss';
@import 'objects/objects-a.scss';
@import 'objects/objects-b.scss';
@import 'objects/objects-c.scss';
4.0.0

9 months ago

4.0.0-next.1

10 months ago

3.0.2

2 years ago

3.0.1

2 years ago

3.0.0

2 years ago

2.0.0-beta.2

3 years ago

2.0.0-beta.1

3 years ago

1.5.0

3 years ago

1.4.0

3 years ago

2.0.0

3 years ago

1.3.0

3 years ago

1.2.1

3 years ago

1.2.0

3 years ago

1.0.1

3 years ago

1.0.0

4 years ago