{"name":"css-modules-loader-core","version":"1.1.0","description":"A loader-agnostic CSS Modules implementation, based on PostCSS","main":"lib/index.js","directories":{"test":"test"},"dependencies":{"icss-replace-symbols":"1.1.0","postcss":"6.0.1","postcss-modules-extract-imports":"1.1.0","postcss-modules-local-by-default":"1.2.0","postcss-modules-scope":"1.1.0","postcss-modules-values":"1.3.0"},"devDependencies":{"babel":"5.8.29","babel-eslint":"7.1.0","babelify":"7.3.0","chokidar-cli":"1.1.0","eslint":"3.10.1","mocha":"3.1.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":"3d8377003ea87f8a32d094b36b1d7bd2abba360f","_id":"css-modules-loader-core@1.1.0","_shasum":"5908668294a1becd261ae0a4ce21b0b551f21d16","_from":".","_npmVersion":"4.1.2","_nodeVersion":"7.6.0","_npmUser":{"name":"geelen","email":"hi@glenmaddern.com"},"dist":{"shasum":"5908668294a1becd261ae0a4ce21b0b551f21d16","tarball":"http://registry-npm.ywwl.com/css-modules-loader-core/download/css-modules-loader-core-1.1.0.tgz","integrity":"sha512-XWOBwgy5nwBn76aA+6ybUGL/3JBnCtBX9Ay9/OWIpzKYWlVHMazvJ+WtHumfi+xxdPF440cWK7JCYtt8xDifew==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFOOCwst2+gzmHHAshhpEfZlRxdlx8zZKPvqGmqm2dPJAiB+krYZVN4FlThXdD8aWWP14dqKsklebi36xcuV5ISxiQ=="}],"size":3938,"noattachment":false,"key":"/css-modules-loader-core/-/css-modules-loader-core-1.1.0.tgz"},"maintainers":[{"name":"geelen","email":"hi@glenmaddern.com"},{"name":"joshwnj","email":"josh@x-team.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/css-modules-loader-core-1.1.0.tgz_1495437131767_0.10835111630149186"},"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":1495437131892,"_cnpm_publish_time":1495437131892,"dist-tags":{"latest":"1.1.0"}}