{"name":"css-modules-loader-core","version":"0.0.6","description":"A loader-agnostic CSS Modules implementation, based on PostCSS","main":"lib/index.js","directories":{"test":"test"},"dependencies":{"postcss":"^4.1.11","postcss-modules-extract-imports":"0.0.3","postcss-modules-local-by-default":"^0.0.7","postcss-modules-scope":"^0.0.5"},"devDependencies":{"babel":"^5.5.4","babel-eslint":"^3.1.14","babelify":"^6.1.2","chokidar-cli":"^0.2.1","eslint":"^0.22.1","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":"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":"eef3868b685bd5d668eeaa87b1a982e685df77e1","_id":"css-modules-loader-core@0.0.6","_shasum":"1c7c76577b0c1d315016d84dc8fa75757d6b08f4","_from":".","_npmVersion":"2.7.6","_nodeVersion":"0.12.2","_npmUser":{"name":"geelen","email":"hi@glenmaddern.com"},"dist":{"shasum":"1c7c76577b0c1d315016d84dc8fa75757d6b08f4","tarball":"http://registry-npm.ywwl.com/css-modules-loader-core/download/css-modules-loader-core-0.0.6.tgz","integrity":"sha512-FkEAci3NunCvCEC4wutjpRbdItGgr9gjk9eza6jBPkxG7BTdXQ/ZcQSIvHeM6nA2ZLOy6EAz/6xm+Bl4NrEWkQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBCDHeF0u2nqMZB81S4KmIrWyohPQ9ZBP8faH76R431IAiB4Li8i0T6ZyF06AqFWM689wKPd+CENqQkBNEUQu9ekAw=="}],"size":3631,"noattachment":false,"key":"/css-modules-loader-core/-/css-modules-loader-core-0.0.6.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":1433649911004,"_cnpm_publish_time":1433649911004,"dist-tags":{"latest":"1.1.0"}}