{"name":"css-modules-loader-core","version":"1.0.1","description":"A loader-agnostic CSS Modules implementation, based on PostCSS","main":"lib/index.js","directories":{"test":"test"},"dependencies":{"icss-replace-symbols":"1.0.2","postcss":"5.1.2","postcss-modules-values":"1.2.2","postcss-modules-extract-imports":"1.0.0","postcss-modules-local-by-default":"1.1.1","postcss-modules-scope":"1.0.2"},"devDependencies":{"babel":"5.8.29","babel-eslint":"4.1.3","babelify":"6.4.0","chokidar-cli":"1.1.0","eslint":"3.3.1","mocha":"3.0.2"},"scripts":{"lint":"eslint src","build":"babel --out-dir lib src","autotest":"chokidar src test -c 'npm test'","test":"mocha --compilers js:babel/register","prepublish":"rm -rf lib/* && npm run build"},"repository":{"type":"git","url":"git+https://github.com/css-modules/css-modules-loader-core.git"},"keywords":["css-modules","postcss","loader"],"files":["lib"],"author":{"name":"Glen Maddern"},"license":"ISC","bugs":{"url":"https://github.com/css-modules/css-modules-loader-core/issues"},"homepage":"https://github.com/css-modules/css-modules-loader-core","gitHead":"c905868308a0e768515b278720972c68c4be85e6","_id":"css-modules-loader-core@1.0.1","_shasum":"94e3eec9bc8174df0f974641f3e0d0550497f694","_from":".","_npmVersion":"3.10.5","_nodeVersion":"5.3.0","_npmUser":{"name":"geelen","email":"hi@glenmaddern.com"},"dist":{"shasum":"94e3eec9bc8174df0f974641f3e0d0550497f694","tarball":"http://registry-npm.ywwl.com/css-modules-loader-core/download/css-modules-loader-core-1.0.1.tgz","integrity":"sha512-qfDtvsZH6d/SzqlIsqnVvW3lTngDFccGH9dzsTEXKwwEni2YZMm516mnV7NEkfHrjU+eWNBm98GFJlF6Cce7Og==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD63BqgzynouqQZd+bg3Z62lAKEUnCfqNpnTYQ3Bv8LfAIhAIAL4/+SglUfWLxcM05rlLLMTEclE5KxupE7ypKkCd1K"}],"size":3942,"noattachment":false,"key":"/css-modules-loader-core/-/css-modules-loader-core-1.0.1.tgz"},"maintainers":[{"name":"geelen","email":"hi@glenmaddern.com"}],"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/css-modules-loader-core-1.0.1.tgz_1471573729843_0.18032007291913033"},"readme":"# CSS Module Loader Core\n> A loader-agnostic CSS Modules implementation, based on PostCSS\n\n[![Build Status](https://travis-ci.org/css-modules/css-modules-loader-core.svg?branch=master)](https://travis-ci.org/css-modules/css-modules-loader-core)\n\n## API\n\n```js\nimport Core from 'css-modules-loader-core'\nlet core = new Core()\n```\n\n### core.load( sourceString , sourcePath , pathFetcher ) =><br>&nbsp;&nbsp;Promise({ injectableSource, exportTokens })\n\nProcesses the input CSS `sourceString`, looking for dependencies such as `@import` or `:import`. Any localisation will happen by prefixing a sanitised version of `sourcePath` When dependencies are found, it will ask the `pathFetcher` for each dependency, resolve & inline any imports, and return the following object:\n\n- `injectableSource`: the final, merged CSS file without `@import` or `:import` statements\n- `exportTokens`: the mapping from local name to scoped name, as described in the file's `:export` block\n\nThese should map nicely to what your build-tool-specific loader needs to do its job.\n\n### new Core([plugins])\n\nThe default set of plugins is [[postcss-modules-local-by-default](https://github.com/css-modules/postcss-modules-local-by-default), [postcss-modules-extract-imports](https://github.com/css-modules/postcss-modules-extract-imports), [postcss-modules-scope](https://github.com/css-modules/postcss-modules-scope)] (i.e. the CSS Modules specification). This can override which PostCSS plugins you wish to execute, e.g.\n\n```js\nimport Core from 'css-loader-core'\nimport autoprefixer from 'autoprefixer'\nimport colorFunctions from 'postcss-color-function'\n\n// Don't run local-by-default, but use colorFunctions \n// beforehand and autoprefixer afterwards:\nlet core = new Core([\n  colorFunctions, \n  core.plugins.extractImports, \n  core.plugins.scope, \n  autoprefixer(\"Last 2 Versions\")\n])\n```\n","publish_time":1471573731985,"_cnpm_publish_time":1471573731985,"dist-tags":{"latest":"1.1.0"}}