postcss-purgecss
Advanced tools
Comparing version 1.0.0 to 2.0.3
{ | ||
"name": "postcss-purgecss", | ||
"version": "1.0.0", | ||
"version": "2.0.3", | ||
"description": "PostCSS plugin for PurgeCSS", | ||
"keywords": [ | ||
"postcss", | ||
"css", | ||
"postcss-plugin", | ||
"purgecss" | ||
], | ||
"author": "FoundrySH <no-reply@foundry.sh>", | ||
"homepage": "https://github.com/FullHuman/purgecss#readme", | ||
"license": "MIT", | ||
"repository": "FoundrySH/postcss-purgecss", | ||
"main": "lib/postcss-purgecss.js", | ||
"module": "lib/postcss-purgecss.esm.js", | ||
"types": "lib/postcss-purgecss.d.ts", | ||
"directories": { | ||
"lib": "lib", | ||
"test": "__tests__" | ||
}, | ||
"files": [ | ||
"lib" | ||
], | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/FullHuman/purgecss.git" | ||
}, | ||
"scripts": { | ||
"test": "echo \"Error: run tests from root\" && exit 1" | ||
}, | ||
"bugs": { | ||
"url": "https://github.com/FoundrySH/postcss-purgecss/issues" | ||
"url": "https://github.com/FullHuman/purgecss/issues" | ||
}, | ||
"homepage": "https://github.com/FoundrySH/postcss-purgecss", | ||
"dependencies": { | ||
"purgecss": "^0.21.0" | ||
"postcss": "7.0.26", | ||
"purgecss": "^2.0.3" | ||
}, | ||
"devDependencies": { | ||
"babel-plugin-external-helpers": "^6.22.0", | ||
"babel-plugin-transform-class-properties": "^6.24.1", | ||
"babel-preset-env": "^1.6.1", | ||
"babel-preset-flow": "^6.23.0", | ||
"eslint": "^4.19.1", | ||
"eslint-config-postcss": "^2.0.2", | ||
"eslint-plugin-flowtype": "^2.46.1", | ||
"jest": "^22.4.2", | ||
"flow-bin": "^0.69.0", | ||
"glob": "^7.1.2", | ||
"postcss": "^6.0.16", | ||
"postcss-selector-parser": "^3.1.1", | ||
"rollup": "^0.57.1", | ||
"rollup-plugin-babel": "^3.0.3", | ||
"rollup-plugin-flow": "^1.1.1", | ||
"rollup-plugin-node-builtins": "^2.1.2", | ||
"rollup-plugin-node-resolve": "^3.3.0", | ||
"rollup-plugin-uglify": "^3.0.0" | ||
}, | ||
"eslintConfig": { | ||
"extends": "eslint-config-postcss/es5", | ||
"env": { | ||
"jest": true | ||
} | ||
}, | ||
"jest": { | ||
"testEnvironment": "node" | ||
} | ||
"gitHead": "8219ff4f78e3fbea93a2e2aceeaef83be3659831" | ||
} |
# PostCSS Purgecss | ||
[![Build Status](https://travis-ci.org/FullHuman/postcss-purgecss.svg?branch=master)](https://travis-ci.org/FullHuman/postcss-purgecss) | ||
[![CircleCi](https://circleci.com/gh/FullHuman/postcss-purgecss/tree/master.svg?style=shield)]() | ||
[![dependencies Status](https://david-dm.org/fullhuman/postcss-purgecss/status.svg)](https://david-dm.org/fullhuman/postcss-purgecss) | ||
[![devDependencies Status](https://david-dm.org/fullhuman/postcss-purgecss/dev-status.svg)](https://david-dm.org/fullhuman/postcss-purgecss?type=dev) | ||
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/2554f9858cb742ed93eb22f49ccec3c3)](https://www.codacy.com/app/FullHuman/postcss-purgecss?utm_source=github.com&utm_medium=referral&utm_content=FullHuman/postcss-purgecss&utm_campaign=Badge_Grade) | ||
[![Codacy Badge](https://api.codacy.com/project/badge/Coverage/2554f9858cb742ed93eb22f49ccec3c3)](https://www.codacy.com/app/FullHuman/postcss-purgecss?utm_source=github.com&utm_medium=referral&utm_content=FullHuman/postcss-purgecss&utm_campaign=Badge_Coverage) | ||
[![styled with prettier](https://img.shields.io/badge/styled_with-prettier-ff69b4.svg)](https://github.com/prettier/prettier) | ||
[![npm](https://img.shields.io/npm/v/postcss-purgecss.svg)](https://www.npmjs.com/package/@fullhuman/postcss-purgecss) | ||
[![license](https://img.shields.io/github/license/fullhuman/postcss-purgecss.svg)]() [![Greenkeeper badge](https://badges.greenkeeper.io/FullHuman/postcss-purgecss.svg)](https://greenkeeper.io/) | ||
@@ -7,8 +16,79 @@ [PostCSS] plugin for PurgeCSS. | ||
## Installation | ||
``` | ||
npm i -D @fullhuman/postcss-purgecss | ||
``` | ||
## Usage | ||
```js | ||
postcss([ require('postcss-purgecss') ]) | ||
const purgecss = require('@fullhuman/postcss-purgecss') | ||
postcss([ | ||
purgecss({ | ||
content: ['./src/**/*.html'] | ||
}) | ||
]) | ||
``` | ||
See [PostCSS] docs for examples for your environment. | ||
## Options | ||
All of the options of purgecss are available to use with the plugins. | ||
You will find below the main options available. For the complete list, go to the [purgecss documentation website](https://www.purgecss.com/configuration.html#options). | ||
### `content` (**required**) | ||
Type: `string | Object` | ||
You can specify content that should be analyzed by Purgecss with an array of filenames or globs. The files can be HTML, Pug, Blade, etc. | ||
### `extractors` | ||
Type: `Array<Object>` | ||
Purgecss can be adapted to suit your needs. If you notice a lot of unused CSS is not being removed, you might want to use a custom extractor. | ||
More information about extractors [here](https://www.purgecss.com/extractors.html). | ||
### `whitelist` | ||
Type: `Array<string>` | ||
You can whitelist selectors to stop Purgecss from removing them from your CSS. This can be accomplished with the options whitelist and whitelistPatterns. | ||
### `whitelistPatterns` | ||
Type: `Array<RegExp>` | ||
You can whitelist selectors based on a regular expression with whitelistPatterns. | ||
### `rejected` | ||
Type: `boolean` | ||
Default value: `false` | ||
If true, purged selectors will be captured and rendered as PostCSS messages. | ||
Use with a PostCSS reporter plugin like [`postcss-reporter`](https://github.com/postcss/postcss-reporter) | ||
to print the purged selectors to the console as they are processed. | ||
### `keyframes` | ||
Type: `boolean` | ||
Default value: `false` | ||
If you are using a CSS animation library such as animate.css, you can remove unused keyframes by setting the keyframes option to true. | ||
#### `fontFace` | ||
Type: `boolean` | ||
Default value: `false` | ||
If there are any unused @font-face rules in your css, you can remove them by setting the fontFace option to true. | ||
## Contributing | ||
Please read [CONTRIBUTING.md](./../../CONTRIBUTING.md) for details on our code of | ||
conduct, and the process for submitting pull requests to us. | ||
## Versioning | ||
postcss-purgecss use [SemVer](http://semver.org/) for versioning. | ||
## License | ||
This project is licensed under the MIT License - see the [LICENSE](./../../LICENSE) file | ||
for details. |
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
0
94
0
9815
2
7
71
2
+ Addedpostcss@7.0.26
+ Addedcommander@5.1.0(transitive)
+ Addedcssesc@3.0.0(transitive)
+ Addedpostcss@7.0.267.0.32(transitive)
+ Addedpostcss-selector-parser@6.1.2(transitive)
+ Addedpurgecss@2.3.0(transitive)
+ Addedsupports-color@6.1.0(transitive)
+ Addedutil-deprecate@1.0.2(transitive)
- Removedansi-regex@2.1.13.0.1(transitive)
- Removedcamelcase@4.1.0(transitive)
- Removedcliui@4.1.0(transitive)
- Removedcode-point-at@1.1.0(transitive)
- Removedcross-spawn@6.0.6(transitive)
- Removeddecamelize@1.2.0(transitive)
- Removeddot-prop@5.3.0(transitive)
- Removedend-of-stream@1.4.4(transitive)
- Removedexeca@1.0.0(transitive)
- Removedfind-up@2.1.0(transitive)
- Removedget-caller-file@1.0.3(transitive)
- Removedget-stream@4.1.0(transitive)
- Removedindexes-of@1.0.1(transitive)
- Removedinvert-kv@2.0.0(transitive)
- Removedis-fullwidth-code-point@1.0.02.0.0(transitive)
- Removedis-obj@2.0.0(transitive)
- Removedis-stream@1.1.0(transitive)
- Removedisexe@2.0.0(transitive)
- Removedlcid@2.0.0(transitive)
- Removedlocate-path@2.0.0(transitive)
- Removedmap-age-cleaner@0.1.3(transitive)
- Removedmem@4.3.0(transitive)
- Removedmimic-fn@2.1.0(transitive)
- Removednice-try@1.0.5(transitive)
- Removednpm-run-path@2.0.2(transitive)
- Removednumber-is-nan@1.0.1(transitive)
- Removedos-locale@3.1.0(transitive)
- Removedp-defer@1.0.0(transitive)
- Removedp-finally@1.0.0(transitive)
- Removedp-is-promise@2.1.0(transitive)
- Removedp-limit@1.3.0(transitive)
- Removedp-locate@2.0.0(transitive)
- Removedp-try@1.0.0(transitive)
- Removedpath-exists@3.0.0(transitive)
- Removedpath-key@2.0.1(transitive)
- Removedpostcss@6.0.23(transitive)
- Removedpostcss-selector-parser@3.1.2(transitive)
- Removedpump@3.0.2(transitive)
- Removedpurgecss@0.21.0(transitive)
- Removedrequire-directory@2.1.1(transitive)
- Removedrequire-main-filename@1.0.1(transitive)
- Removedsemver@5.7.2(transitive)
- Removedset-blocking@2.0.0(transitive)
- Removedshebang-command@1.2.0(transitive)
- Removedshebang-regex@1.0.0(transitive)
- Removedsignal-exit@3.0.7(transitive)
- Removedstring-width@1.0.22.1.1(transitive)
- Removedstrip-ansi@3.0.14.0.0(transitive)
- Removedstrip-eof@1.0.0(transitive)
- Removeduniq@1.0.1(transitive)
- Removedwhich@1.3.1(transitive)
- Removedwhich-module@2.0.1(transitive)
- Removedwrap-ansi@2.1.0(transitive)
- Removedy18n@3.2.2(transitive)
- Removedyargs@11.1.1(transitive)
- Removedyargs-parser@9.0.2(transitive)
Updatedpurgecss@^2.0.3