{"name":"sass-module-importer","version":"1.2.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":{"prebuild":"npm test","build":"rollup -c","lint":"eslint src/index.js test.js","pretest":"npm run lint","test":"BABEL_ENV=test mocha --compilers js:babel-register","prepublish":"npm run build","preversion":"npm test","version":"npm run build","postversion":"git push && git push --tags"},"devDependencies":{"babel-preset-es2015":"^6.6.0","babel-preset-es2015-rollup":"^1.1.1","babel-register":"^6.6.5","chai":"^3.5.0","eslint":"^2.3.0","eslint-config-airbnb":"^6.1.0","mocha":"^2.4.5","node-sass":"^3.4.2","rollup":"^0.25.4","rollup-plugin-babel":"^2.4.0","rollup-plugin-commonjs":"^2.2.1"},"dependencies":{"es6-map":"0.1.3","object-assign":"4.0.1","resolve":"1.1.7","resolve-bower":"0.0.1"},"gitHead":"9c2cd36e397cbc5291f91404481f713bd161193c","homepage":"https://github.com/lucasmotta/sass-module-importer#readme","_id":"sass-module-importer@1.2.0","_shasum":"29a3d7125fbb5015f420e94a6c0e3b12966d6517","_from":".","_npmVersion":"3.6.0","_nodeVersion":"5.6.0","_npmUser":{"name":"lucasmotta","email":"mail@lucasmotta.com"},"dist":{"shasum":"29a3d7125fbb5015f420e94a6c0e3b12966d6517","tarball":"http://registry-npm.ywwl.com/sass-module-importer/download/sass-module-importer-1.2.0.tgz","integrity":"sha512-ITOP+ptS2pHcjYx0R8B9Lpl74c+VW0rJ8rTVG5qdEPGrpBvViTluc0HUY8JLwILHmoaSToPMXlAn8GtsJwidEw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEL5mglBQoPScrWSRfIwRzDfA2U7wfVL8kqGj1fxWn9CAiATU4INIUUYxZA7mWq984nXG8JS1vcqMzwC/zfk/MTuhg=="}],"size":6046,"noattachment":false,"key":"/sass-module-importer/-/sass-module-importer-1.2.0.tgz"},"maintainers":[{"name":"lucasmotta","email":"mail@lucasmotta.com"}],"_npmOperationalInternal":{"host":"packages-13-west.internal.npmjs.com","tmp":"tmp/sass-module-importer-1.2.0.tgz_1458490031006_0.664136353880167"},"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":1458490033455,"_cnpm_publish_time":1458490033455,"dist-tags":{"latest":"1.4.0"}}