@mightyplow/sass-dedup-importer

1.1.1 • Public • Published

sass-dedup-importer

An importer function which can be used with node-sass. It ensures that multiple import statements in sass/scss files get only imported once.

Installation

npm i -D @mightyplow/sass-dedup-importer

Usage

Note

The function only takes the filenames into account, since for now I cannot resolve the original paths in a reliable way. So make sure, the filenames are unique.

cli

node-sass --importer node_modules/@mightyplow/sass-dedup-importer/importer.js ...

node

In node you can just pass the importer function to the node-sass options. To use the importer in your build tool please read its documentation on how to pass options to node-sass.

const sass = require('node-sass');
const importer = require('@mightyplow/sass-dedup-importer');
 
sass.render({
    ...
    importer: importer
    ...

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.1.1
    1
    • latest

Version History

Package Sidebar

Install

npm i @mightyplow/sass-dedup-importer

Weekly Downloads

1

Version

1.1.1

License

ISC

Last publish

Collaborators

  • mightyplow