{"name":"sass-module-importer","version":"1.4.0","main":"lib/index.js","jsnext:main":"src/index.js","description":"Import Sass files from NPM and Bower Modules","author":{"name":"Lucas Motta","email":"mail@lucasmotta.com","url":"lucasmotta.com"},"repository":{"type":"git","url":"git+https://github.com/lucasmotta/sass-module-importer.git"},"bugs":{"url":"https://github.com/lucasmotta/sass-module-importer/issues"},"license":"MIT","keywords":["sass","scss","importer","module","npm","node-sass","bower"],"scripts":{"build":"rollup -c","lint":"eslint src/index.js test.js","pretest":"npm run lint && npm run build","test":"mocha --compilers js:buble/register","prepublish":"npm test","preversion":"npm test","version":"npm run build","postversion":"git push && git push --tags"},"devDependencies":{"buble":"^0.5.6","chai":"^3.5.0","eslint":"^2.8.0","eslint-config-airbnb":"^6.1.0","mocha":"^2.4.5","node-sass":"^3.4.2","rollup":"^0.25.4","rollup-plugin-buble":"^0.5.0","rollup-plugin-commonjs":"^3.1.0","rollup-plugin-json":"^2.0.0","rollup-plugin-node-resolve":"^1.5.0"},"dependencies":{"es6-map":"0.1.3","glob":"^7.1.1","object-assign":"4.0.1","resolve":"1.1.7","resolve-bower":"0.0.1"},"gitHead":"adb115188a7a07119d08b0456b74b7abef32c70d","homepage":"https://github.com/lucasmotta/sass-module-importer#readme","_id":"sass-module-importer@1.4.0","_shasum":"ed0400f9c1a40f017790a1772da0beb5432f9149","_from":".","_npmVersion":"3.10.3","_nodeVersion":"6.4.0","_npmUser":{"name":"lucasmotta","email":"mail@lucasmotta.com"},"dist":{"shasum":"ed0400f9c1a40f017790a1772da0beb5432f9149","tarball":"http://registry-npm.ywwl.com/sass-module-importer/download/sass-module-importer-1.4.0.tgz","integrity":"sha512-9rq7FqVOguXz2zEEJt5htcGXwwg1KS+MqFEY9CfGdG9Z5Fb/m+olscN7bzB197Vr8UEokhORJEKxjeJgjaBxgA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDVvf1Q0fTdzj1Dob56c/Os3s6YnZtHt2at74mccR9oIQIgLRdP3tMfbyVIIp5TOa8AWOqKaaAlIJohhfZow0y8Bl8="}],"size":6816,"noattachment":false,"key":"/sass-module-importer/-/sass-module-importer-1.4.0.tgz"},"maintainers":[{"name":"lucasmotta","email":"mail@lucasmotta.com"}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/sass-module-importer-1.4.0.tgz_1479297814123_0.3738215435296297"},"directories":{},"readme":"[![Build Status](https://travis-ci.org/lucasmotta/sass-module-importer.svg?branch=master)](https://travis-ci.org/lucasmotta/sass-module-importer)\n\n# sass-module-importer\n\nSimple importer for [node-sass](https://github.com/sass/node-sass) to import [npm](https://www.npmjs.com) and [bower](http://bower.io/search/) modules.\n\nSay good-bye to all the mess with relative paths on your Sass files.  \nYou can now import your Sass/SCSS modules by referencing to the module name, like this:\n\n```sass\n@import \"sass-easing\";\n@import \"quantum-colors\";\n@import \"inuit-defaults\";\n@import \"inuit-functions\";\n@import \"inuit-mixins\";\n@import \"inuit-box-sizing\";\n@import \"inuit-normalize\";\n@import \"inuit-page\";\n// :)\n```\n\nJust for comparison, look at this mess:\n\n```sass\n@import \"node_modules/sass-easing/_easings.scss\";\n@import \"bower_components/quantum-colors/_quantum-colors.scss\";\n@import \"bower_components/inuit-defaults/settings.defaults\";\n@import \"bower_components/inuit-functions/tools.functions\";\n@import \"bower_components/inuit-mixins/tools.mixins\";\n@import \"bower_components/inuit-normalize/generic.normalize\";\n@import \"bower_components/inuit-box-sizing/generic.box-sizing\";\n@import \"bower_components/inuit-page/base.page\";\n// :(\n```\n\nAssuming that the external library you are installing fits under one of those categories:\n\n1. Set a SCSS/Sass/CSS file on the \"main\" field of their package.json/bower.json\n2. Set a SCSS/Sass/CSS file on the \"style\" field of their package.json/bower.json\n3. Have a `index.css` file on the root of their module\n\nThis tool it will also inline CSS files for you, since Sass [cannot import plain CSS files yet](https://github.com/sass/sass/issues/556). So if the dependency you are using exports a CSS file, it will work too.\n\n\n## How-to\n\n### install\n\n```sh\nnpm install sass-module-importer --save-dev\n```\n\n### use the importer with [node-sass](https://github.com/sass/node-sass) `>= v3.0.0`\n\n```js\nimport sass from 'node-sass';\nimport moduleImporter from 'sass-module-importer';\n\nsass.render({\n  file: './source/css/app.scss',\n  importer: moduleImporter()\n}, cb);\n```\n\n### use the importer with [gulp-sass](https://github.com/dlmanning/gulp-sass)\n\n```js\nimport gulp from 'gulp';\nimport sass from 'gulp-sass';\nimport moduleImporter from 'sass-module-importer';\n\ngulp.task('style', () => {\n  return gulp.src('./source/css/app.scss')\n    .pipe(sass({ importer: moduleImporter() }))\n    .pipe(gulp.dest('./public/css'));\n});\n```\n\n### import partials\n\nIf you need to import partials from your external module, just use the path for the partial you want to import. To import the following file:\n```\nnode_modules/module-name/folder/to/_file.scss\n```\n\nImport like this anywhere:\n\n```scss\n@import \"module-name/folder/to/_file.scss\"\n```\n\n## Options\nYou can pass any option supported by [node-resolve](https://github.com/substack/node-resolve#resolveid-opts-cb) directly, like this:\n```js\nmoduleImporter({ basedir: path.join(__dirname, 'another-folder') });\n```\n\n## Tests\nUse `npm test` to run the tests.\n\n## Issues\nIf you discover a bug, please raise an issue on Github. https://github.com/lucasmotta/sass-module-importer/issues\n\n## Contributors\nThe source code and the test are written in ES6 (ECMAScript 2015).  \n[Buble](https://gitlab.com/Rich-Harris/buble) is being used to compile to ES5 before the package is published to npm.\n","publish_time":1479297814670,"_cnpm_publish_time":1479297814670,"dist-tags":{"latest":"1.4.0"}}