postcss-discard-unused
Advanced tools
Comparing version 2.2.0 to 2.2.1
@@ -0,1 +1,5 @@ | ||
# 2.2.1 | ||
* Now compiled with Babel 6. | ||
# 2.2.0 | ||
@@ -2,0 +6,0 @@ |
'use strict'; | ||
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; | ||
var _uniqs = require('uniqs'); | ||
@@ -69,5 +71,3 @@ | ||
atRules.forEach(function (atRule) { | ||
var _atRule$params$split$ = atRule.params.split(' ').filter(function (e) { | ||
return e !== ''; | ||
}); | ||
var _atRule$params$split$ = atRule.params.split(' ').filter(Boolean); | ||
@@ -119,14 +119,25 @@ var param = _atRule$params$split$[0]; | ||
module.exports = _postcss2.default.plugin('postcss-discard-unused', function (opts) { | ||
opts = opts || {}; | ||
var _fontFace$counterStyl = _extends({ | ||
fontFace: true, | ||
counterStyle: true, | ||
keyframes: true, | ||
namespace: true | ||
}, opts); | ||
var fontFace = _fontFace$counterStyl.fontFace; | ||
var counterStyle = _fontFace$counterStyl.counterStyle; | ||
var keyframes = _fontFace$counterStyl.keyframes; | ||
var namespace = _fontFace$counterStyl.namespace; | ||
return function (css) { | ||
if (opts.fontFace !== false) { | ||
if (fontFace) { | ||
filterFont(css); | ||
} | ||
if (opts.counterStyle !== false) { | ||
if (counterStyle) { | ||
filterAtRule(css, /list-style|system/, /counter-style/); | ||
} | ||
if (opts.keyframes !== false) { | ||
if (keyframes) { | ||
filterAtRule(css, /animation/, /keyframes/); | ||
} | ||
if (opts.namespace !== false) { | ||
if (namespace) { | ||
filterNamespace(css); | ||
@@ -133,0 +144,0 @@ } |
{ | ||
"name": "postcss-discard-unused", | ||
"version": "2.2.0", | ||
"version": "2.2.1", | ||
"description": "Discard unused counter styles, keyframes and fonts.", | ||
@@ -12,3 +12,3 @@ "main": "dist/index.js", | ||
"scripts": { | ||
"prepublish": "de dist && BABEL_ENV=publish babel src --out-dir dist --ignore /__tests__/", | ||
"prepublish": "del-cli dist && BABEL_ENV=publish babel src --out-dir dist --ignore /__tests__/", | ||
"pretest": "eslint src", | ||
@@ -34,4 +34,5 @@ "test": "ava src/__tests__" | ||
"babel-preset-stage-0": "^6.3.13", | ||
"del-cli": "^0.1.2", | ||
"eslint": "^1.10.3" | ||
"del-cli": "^0.2.0", | ||
"eslint": "^1.10.3", | ||
"eslint-config-cssnano": "^1.0.0" | ||
}, | ||
@@ -52,3 +53,6 @@ "homepage": "https://github.com/ben-eb/postcss-discard-unused", | ||
"require": "babel-core/register" | ||
}, | ||
"eslintConfig": { | ||
"extends": "cssnano" | ||
} | ||
} |
@@ -109,3 +109,5 @@ # [postcss][postcss]-discard-unused [![Build Status](https://travis-ci.org/ben-eb/postcss-discard-unused.svg?branch=master)][ci] [![NPM version](https://badge.fury.io/js/postcss-discard-unused.svg)][npm] [![Dependency Status](https://gemnasium.com/ben-eb/postcss-discard-unused.svg)][deps] | ||
Pass `false` to disable discarding unused namespace rules. | ||
## Contributing | ||
@@ -112,0 +114,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
9921
124
127
10