{"_id":"@cameron-martin/css-modules-loader-core","_rev":"3-707b12d3566d7188216f3dc52d1a7b5d","name":"@cameron-martin/css-modules-loader-core","description":"A loader-agnostic CSS Modules implementation, based on PostCSS","dist-tags":{"latest":"1.0.1"},"versions":{"1.0.1":{"name":"@cameron-martin/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.2.0","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.5.0","mocha":"3.0.2","rimraf":"^2.5.4"},"scripts":{"lint":"eslint src","build":"babel --out-dir lib src","autotest":"chokidar src test -c 'npm test'","test":"mocha --compilers js:babel/register","prepublish":"rimraf 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":"c43b7bc2092126816d57d7c8c07c9e4dbd612509","_id":"@cameron-martin/css-modules-loader-core@1.0.1","_shasum":"435022680e41919a64ed4198e2531bc78143af26","_from":".","_npmVersion":"3.10.3","_nodeVersion":"6.7.0","_npmUser":{"name":"cameron-martin","email":"cameronmartin123@gmail.com"},"dist":{"shasum":"435022680e41919a64ed4198e2531bc78143af26","tarball":"https://registry.npmjs.org/@cameron-martin/css-modules-loader-core/-/css-modules-loader-core-1.0.1.tgz","integrity":"sha512-36WzmbNQfJ4LphnO6V0rwsGW0qWpQ/nJ9+rSFnGptcWNtmsBsyWNNPlclwIuCIMbdQgiIhztg66fuPuIgDp8aw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCJD3PbPbKoRR8na6Ryzy3fYbX2s4eqi1vxVlrNfouhJwIhALKVkZl5KsQja/jmiwbdjeRrWWGrRzxiyLG7AhVuBUra"}]},"maintainers":[{"name":"cameron-martin","email":"cameronmartin123@gmail.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/css-modules-loader-core-1.0.1.tgz_1475157086757_0.37339225481264293"}}},"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","maintainers":[{"name":"cameron-martin","email":"cameronmartin123@gmail.com"}],"time":{"modified":"2022-06-12T15:38:00.031Z","created":"2016-09-29T13:51:28.482Z","1.0.1":"2016-09-29T13:51:28.482Z"},"homepage":"https://github.com/css-modules/css-modules-loader-core","keywords":["css-modules","postcss","loader"],"repository":{"type":"git","url":"git+https://github.com/css-modules/css-modules-loader-core.git"},"author":{"name":"Glen Maddern"},"bugs":{"url":"https://github.com/css-modules/css-modules-loader-core/issues"},"license":"ISC","readmeFilename":"README.md"}