New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

sass-import-modules

Package Overview
Dependencies
Maintainers
4
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sass-import-modules

SASS/SCSS Import function to import files from node_modules

latest
Source
npmnpm
Version
8.0.0
Version published
Maintainers
4
Created
Source

SASS import modules

Greenkeeper badge

Version npmBuild StatusDependenciesCoverage Status

SASS/SCSS helper function to import modules or files from node_modules without the need to specify full paths. For example, @import "node_modules/test/file.scss"; will become @import "test/file";. The order of resolvers is configurable, e.g. partials can be given priority over node_modules.

Install

npm install --save sass-import-modules

Usage

CLI

Basic support for CLI usage exists

node-sass --importer sass-import-modules test/fixtures/index.scss
node-sass

If your using node-sass programmatically, add the importer to options.

const { importer } = require('sass-import-modules');

sass.render({
  importer: importer(/* { options } */)
}, (error, result) => {
  // node-sass output
})
Webpack

Add the importer to the sassLoader options.

const { importer } = require('sass-import-modules');

module.exports = {
  sassLoader: {
    importer: importer(/* { options } */)
  }
}

Options

The following options are supported, provide them as object to the importer:

const { importer } = require('sass-import-modules');

  importer(/* { options } */);
  • extension file extension, i.e ['.scss'], ['.sass'], ['scss'] or ['sass'] (default: ['.scss', '.css']).
  • resolvers order of and set of resolvers to use (default: ['local', 'tilde', 'node', 'partial']):
    • local,
    • tilde,
    • node,
    • partial
  • paths additional lookup paths, should be absolute.

License

MIT

FAQs

Package last updated on 31 Mar 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts