{"name":"purgecss-webpack-plugin","version":"1.0.0","description":"Purgecss plugin for webpack - Remove unused css","main":"./lib/purgecss-webpack-plugin.js","module":"./lib/purgecss-webpack-plugin.es.js","jsnext:main":"./lib/purgecss-webpack-plugin.es.js","directories":{"lib":"lib","test":"__tests__","example":"examples"},"files":["lib/"],"scripts":{"build":"rollup -c rollup.config.js","dev":"rollup -c rollup.config.js -w","test":"npx jest .+.test.js","lint":"eslint -c .eslintrc src/","prettier":"npx prettier --write --print-width 100 --tab-width 4 --no-semi --single-quote '{src,__{tests,mocks}__}/**/*.js'"},"repository":{"type":"git","url":"git+https://github.com/FullHuman/purgecss-webpack-plugin.git"},"keywords":["webpack-plugin","purgecss","remove","unused","css"],"author":{"name":"Ffloriel"},"license":"MIT","bugs":{"url":"https://github.com/FullHuman/purgecss-webpack-plugin/issues"},"homepage":"https://github.com/FullHuman/purgecss-webpack-plugin#readme","devDependencies":{"babel-eslint":"^8.2.2","babel-plugin-external-helpers":"^6.22.0","babel-plugin-syntax-object-rest-spread":"^6.13.0","babel-plugin-transform-object-rest-spread":"^6.26.0","babel-preset-env":"^1.6.1","codacy-coverage":"^2.1.0","css-loader":"^0.28.10","eslint":"^4.18.1","jest":"^22.4.2","prettier":"^1.11.1","rollup":"^0.56.3","rollup-plugin-babel":"^3.0.3","rollup-plugin-commonjs":"^8.3.0","rollup-plugin-node-resolve":"^3.0.3","rollup-watch":"^4.3.1","webpack-cli":"^2.0.9"},"dependencies":{"extract-text-webpack-plugin":"^4.0.0-beta.0","purgecss":"^0.20.0","webpack":"^4.0.1","webpack-sources":"^1.1.0"},"readme":"# purgecss-webpack-plugin\n\n[![Build Status](https://travis-ci.org/FullHuman/purgecss-webpack-plugin.svg?branch=master)](https://travis-ci.org/FullHuman/purgecss-webpack-plugin)\n[![CircleCi](https://circleci.com/gh/FullHuman/purgecss-webpack-plugin/tree/master.svg?style=shield)]()\n[![dependencies Status](https://david-dm.org/fullhuman/purgecss-webpack-plugin/status.svg)](https://david-dm.org/fullhuman/purgecss-webpack-plugin)\n[![devDependencies Status](https://david-dm.org/fullhuman/purgecss-webpack-plugin/dev-status.svg)](https://david-dm.org/fullhuman/purgecss-webpack-plugin?type=dev)\n[![Codacy Badge](https://api.codacy.com/project/badge/Grade/c23bd13d30104a7a89bed239166aaf69)](https://www.codacy.com/app/FullHuman/purgecss-webpack-plugin?utm_source=github.com&utm_medium=referral&utm_content=FullHuman/purgecss-webpack-plugin&utm_campaign=Badge_Grade)\n[![Codacy Badge](https://api.codacy.com/project/badge/Coverage/c23bd13d30104a7a89bed239166aaf69)](https://www.codacy.com/app/FullHuman/purgecss-webpack-plugin?utm_source=github.com&utm_medium=referral&utm_content=FullHuman/purgecss-webpack-plugin&utm_campaign=Badge_Coverage)\n[![styled with prettier](https://img.shields.io/badge/styled_with-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![npm](https://img.shields.io/npm/v/purgecss-webpack-plugin.svg)](https://www.npmjs.com/package/purgecss-webpack-plugin)\n[![license](https://img.shields.io/github/license/fullhuman/purgecss-webpack-plugin.svg)]()\n\n[Webpack](https://github.com/webpack/webpack) plugin to remove unused css.\n\n## Install\n\n```sh\n# webpack 3\nnpm i purgecss-webpack-plugin -D\n\n# webpack 4\nnpm i purgecss-webpack-plugin@next -D\n```\n\n## Usage\n\n```js\nconst path = require('path')\nconst glob = require('glob')\nconst ExtractTextPlugin = require('extract-text-webpack-plugin')\nconst PurgecssPlugin = require('purgecss-webpack-plugin')\n\nconst PATHS = {\n  src: path.join(__dirname, 'src')\n}\n\nmodule.exports = {\n  entry: './src/index.js',\n  output: {\n    filename: 'bundle.js',\n    path: path.join(__dirname, 'dist')\n  },\n  module: {\n    rules: [\n      {\n        test: /\\.css$/,\n        use: ExtractTextPlugin.extract({\n          fallback: 'style-loader',\n          use: 'css-loader?sourceMap'\n        })\n      }\n    ]\n  },\n  plugins: [\n    new ExtractTextPlugin('[name].css?[hash]'),\n    new PurgecssPlugin({\n      paths: glob.sync(`${PATHS.src}/**/*`, { nodir: true })\n    })\n  ]\n}\n```\n\n### Options\n\nThe options available in purgecss [Configuration](https://www.purgecss.com/configuration.html) are also avaiable in the webpack plugin with the exception of css and content.\n\n* #### paths\n\nWith the webpack plugin, you can specified the content that should be analyized by purgecss with an array of filename. It can be html, pug, blade, ... files. You can use a module like `glob` or `glob-all` to easily get a list of files.\n\n```js\nconst PurgecssPlugin = require('purgecss-webpack-plugin')\nconst glob = require('glob')\nconst PATHS = {\n  src: path.join(__dirname, 'src')\n}\n\n// In the webpack configuration\nnew PurgecssPlugin({\n  paths: glob.sync(`${PATHS.src}/**/*`, { nodir: true })\n})\n```\n\nIf you want to regenerate the paths list on every compilation (e.g. with `--watch`), then you can also pass a function:\n```js\nnew PurgecssPlugin({\n  paths: () => glob.sync(`${PATHS.src}/**/*`, { nodir: true })\n})\n```\n\n* #### only\n\nYou can specify entrypoints to the purgecss-webpack-plugin with the option only:\n\n```js\nnew PurgecssPlugin({\n  paths: glob.sync(`${PATHS.src}/**/*`, { nodir: true }),\n  only: ['bundle', 'vendor']\n})\n```\n\n* #### whitelist and whitelistPatterns\n\nSimilar as for the `paths` option, you also can define functions for the these options:\n\n```js\nfunction collectWhitelist() {\n    // do something to collect the whitelist\n    return ['whitelisted'];\n}\nfunction collectWhitelistPatterns() {\n    // do something to collect the whitelist\n    return [/^whitelisted-/];\n}\n\n// In the webpack configuration\nnew PurgecssPlugin({\n  whitelist: collectWhitelist,\n  whitelistPatterns: collectWhitelistPatterns\n})\n```\n\n## Contributing\n\nPlease read [CONTRIBUTING.md](./CONTRIBUTING.md) for details on our code of conduct, and the process for submitting pull requests to us.\n\n## Versioning\n\nWe use [SemVer](http://semver.org/) for versioning.\n\n## Acknowledgment\n\nPurgecss was originally thought as the v2 of purifycss. And because of it, it is greatly inspired by it.\nThe plugins such as purgecss-webpack-plugin are based on the purifycss plugin.\nBelow is the list of the purifycss repositories:\n\n* [purifycss](https://github.com/purifycss/purifycss)\n* [gulp-purifycss](https://github.com/purifycss/gulp-purifycss)\n* [purifycss-webpack](https://github.com/webpack-contrib/purifycss-webpack)\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details\n","readmeFilename":"README.md","gitHead":"d9e62771f78fa8528cd0dfc16791f33b345d9dcd","_id":"purgecss-webpack-plugin@1.0.0","_npmVersion":"5.7.1","_nodeVersion":"8.10.0","_npmUser":{"name":"ffloriel","email":"ffloriel.dev@gmail.com"},"dist":{"integrity":"sha512-InfNqKE/KYb6rWLkPppYDG6T8twbCPOOBkaXymSps1ASsxo3o32XmYv4aWvqks0y6v9PXqtApFZqOPJBtj0FMQ==","shasum":"70d892b63d1891cc762321818b5f203c1236d4b0","tarball":"http://registry-npm.ywwl.com/purgecss-webpack-plugin/download/purgecss-webpack-plugin-1.0.0.tgz","fileCount":5,"unpackedSize":23713,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDI2u2uj83KonuKDaVmCdL+jfcP4jonWF+Nx339+OGHMgIhAJbBobUqXqQnzq2+ysVRWc9fTiiRH8UNRPHs9tJdHZJF"}],"size":5376,"noattachment":false,"key":"/purgecss-webpack-plugin/-/purgecss-webpack-plugin-1.0.0.tgz"},"maintainers":[{"email":"ffloriel.dev@gmail.com","name":"ffloriel"},{"email":"megamaaaan@gmail.com","name":"jsnanigans"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/purgecss-webpack-plugin_1.0.0_1521789276449_0.9316798120886371"},"_hasShrinkwrap":false,"publish_time":1521789276568,"_cnpm_publish_time":1521789276568,"dist-tags":{"latest":"8.0.0","next":"3.1.3-alpha.0"}}