5.3.3 • Published 10 months ago

node-sass-glob-importer v5.3.3

Weekly downloads
40,386
License
MIT
Repository
github
Last release
10 months ago

node-sass-glob-importer

Patreon Donate Build Status Coverage Status GitHub stars

Custom node-sass importer to which allows you to use glob syntax in imports

Globbing allows pattern matching operators to be used to match multiple files at once.

// Import all files inside the `scss` directory and subdirectories.
@import: 'scss/**/*.scss';

Usage

const sass = require('node-sass');
const globImporter = require('node-sass-glob-importer');

sass.render({
  ...
  importer: globImporter()
  ...
});

webpack

// webpack.config.js
const globImporter = require('node-sass-glob-importer');
const MiniCssExtractPlugin = require('mini-css-extract-plugin');

module.exports = {
  module: {
    rules: [
      {
        test: /\.scss$/,
        use: [
          {
            loader: MiniCssExtractPlugin.loader,
          },
          {
            loader: 'css-loader'
          }, {
            loader: 'sass-loader',
            options: {
              sassOptions: {
                importer: globImporter()
              }
            }
          }
        ]
      }
    ]
  },
  plugins: [
    new MiniCssExtractPlugin({
      filename: 'style.css'
    })
  ]
}

CLI

node-sass --importer node_modules/node-sass-glob-importer/dist/cli.js -o dist src/index.scss

Upgrade from 3.x.x to 5.x.x

It is not possible anymore to set the includePaths option when initializing the importer. Use the node-sass includePaths option instead.

Why is there no 4.x version?

This module is maintained in one repository together with multiple other node-sass custom importers. The node-sass-magic-importer repository is using a monorepo approach with fixed versions for all packages. The projects maintained in the node-sass-magic-importer monorepo started out as separate repositories with separate versioning, so when they were integrated into the monorepo, the versions of all projects were raised to 5.0.0 and are in sync since then.

node-sass-magic-importer

This module is powered by node-sass-magic-importer.

About

Author

Markus Oberlehner
Website: https://markus.oberlehner.net
Twitter: https://twitter.com/MaOberlehner
PayPal.me: https://paypal.me/maoberlehner
Patreon: https://www.patreon.com/maoberlehner

License

MIT

5.3.3

10 months ago

5.3.2

5 years ago

5.3.1

5 years ago

5.3.0

5 years ago

5.2.0

6 years ago

5.1.3

6 years ago

5.1.2

6 years ago

5.1.1

6 years ago

5.1.0

6 years ago

5.0.3

6 years ago

5.0.2

6 years ago

5.0.1

6 years ago

5.0.0

6 years ago

5.0.0-alpha.17

6 years ago

5.0.0-alpha.16

6 years ago

5.0.0-alpha.15

7 years ago

5.0.0-alpha.14

7 years ago

5.0.0-alpha.13

7 years ago

5.0.0-alpha.12

7 years ago

5.0.0-alpha.11

7 years ago

5.0.0-alpha.10

7 years ago

5.0.0-alpha.9

7 years ago

5.0.0-alpha.8

7 years ago

5.0.0-alpha.7

7 years ago

5.0.0-alpha.6

7 years ago

5.0.0-alpha.5

7 years ago

5.0.0-alpha.4

7 years ago

5.0.0-alpha.3

7 years ago

5.0.0-alpha.2

7 years ago

5.0.0-alpha.1

7 years ago

3.0.2

7 years ago

3.0.1

7 years ago

3.0.0

7 years ago

2.0.10

8 years ago

2.0.9

8 years ago

2.0.8

8 years ago

2.0.7

8 years ago

2.0.6

8 years ago

2.0.5

8 years ago

2.0.4

8 years ago

2.0.3

8 years ago

2.0.2

8 years ago

2.0.1

8 years ago

2.0.0

8 years ago

1.0.0

8 years ago

0.1.0

8 years ago

0.0.1

8 years ago