node-sass-module-importer

Allows sass files to be imported from node_modules using '~', like webpacks loader

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
node-sass-module-importer
020.1.07 years ago7 years agoMinified + gzip package size for node-sass-module-importer in KB

Readme

node-sass module importer

Install

npm install --save-dev node-sass-module-importer

Usage

var moduleImporter = require('node-sass-module-importer');

var sass = require('node-sass');
sass.render({
  file: scss_filename,
  {
    importer: moduleImporter
  }
}, function(err, result) { /*...*/ });
// OR
var result = sass.renderSync({
  data: scss_content,
  {
    importer: moduleImporter
  }
});
Then in your .scss file you can reference .scss from nodemodules by prefixing your imports with '~'
@import '~sass-project-name/variables';