{"name":"css-modules-loader-core","version":"1.0.0-beta4","description":"A loader-agnostic CSS Modules implementation, based on PostCSS","main":"lib/index.js","directories":{"test":"test"},"dependencies":{"icss-replace-symbols":"^1.0.0","postcss":"^5.0.5","postcss-modules-values":"^1.0.0","postcss-modules-extract-imports":"1.0.0-beta2","postcss-modules-local-by-default":"1.0.0-beta1","postcss-modules-scope":"1.0.0-beta2"},"devDependencies":{"babel":"^5.5.4","babel-eslint":"^4.1.3","babelify":"^6.1.2","chokidar-cli":"^1.0.1","eslint":"^1.5.0","mocha":"^2.2.5"},"scripts":{"lint":"eslint src","build":"babel --out-dir lib src","autotest":"chokidar src test -c 'npm test'","test":"mocha --compilers js:babel/register","prepublish":"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":"9f8e9b5523a38d37b1da81375db01bee726271bf","_id":"css-modules-loader-core@1.0.0-beta4","_shasum":"2a239c9100882fce5ccea67e231feebf31349314","_from":".","_npmVersion":"2.13.1","_nodeVersion":"0.12.2","_npmUser":{"name":"geelen","email":"hi@glenmaddern.com"},"dist":{"shasum":"2a239c9100882fce5ccea67e231feebf31349314","tarball":"http://registry-npm.ywwl.com/css-modules-loader-core/download/css-modules-loader-core-1.0.0-beta4.tgz","integrity":"sha512-w2Iv0fnBSaoDsGW3HRDhNTRxcX97w+XaPd6A74iZn/JPlT7EQk38N0WT0FRO5I3FlSqIss/qJpIisGJk060Upg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFhNYc5K7fGPjkdwQ0CcXlh/sykAmwR2PAa1WeZ4GDpTAiEAlL0F48OPbAKzOA4+BxcWAHRruFw6aU373OCAfVK60pc="}],"size":5424,"noattachment":false,"key":"/css-modules-loader-core/-/css-modules-loader-core-1.0.0-beta4.tgz"},"maintainers":[{"name":"geelen","email":"hi@glenmaddern.com"}],"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":1442915543231,"_cnpm_publish_time":1442915543231,"dist-tags":{"latest":"1.1.0"}}