Releases: FullHuman/purgecss
v7.0.2
Bug Fixes
- fix: fix issue where pseudo classes like :where, :not, :is were always removed at root level (89024ce), closes #1282 #978
- build: add named export for postcss plugin (87d15b7), closes #1263
Features
- feat(purgecss-from-pug): returns ExtractorResultDetailed instead of selectors (fb51dc6)
BREAKING CHANGES
- PostCSS plugin should now be imported via purgeCSSPlugin
import { purgeCSSPlugin } from '@fullhuman/postcss-purgecss';
- drop support for node 18.
Other
- build(deps-dev): update dependencies
- build(deps): update dependencies
Full Changelog: v6.0.0...v7.0.2
v6.0.0
Bug Fixes
- collect of used variables for changed selector (#1217) (9fbb592)
- gulp-purgecss: move vinyl-sourcemaps-apply to deps #999 (7858b7a)
- Only throw
No files found from the passed PurgeCSS option 'content'.
warning when files/globs are passed tocontent
by @AdrianGonz97 in #1188 - Classes that contain
:is
or:where
in their names are no longer unintentionally purged by @AdrianGonz97 in #1187 - Fix [class*=foo] with HTML extractor by @Gaelan in #1133
Features
Breaking changes
- Supports NodeJS 18+
What's Changed (full list)
-
build(deps-dev): update dependencies
-
build(deps): update dependencies
-
Update hugo.md by @davidsneighbour in #1013
-
Minor adjustment to documentation for clarity by @dvelguru in #997
-
Fix wrong import name in #1015
-
Point to new extractor package names by @danieldiekmeier in #1024
-
Clarify node package installation for Hugo guide by @anakinsleftleg in #1000
-
Add alignwide and alignfull classes from GB by @nextgenthemes in #1072
-
bugfix: Only throw
No files found from the passed PurgeCSS option 'content'.
warning when files/globs are passed tocontent
by @AdrianGonz97 in #1188 -
bugfix: Classes that contain
:is
or:where
in their names are no longer unintentionally purged by @AdrianGonz97 in #1187 -
Update Hugo docs by @schnerring in #1216
-
fixed collect used variables for the changed selector by @vsn4ik in #1217
New Contributors
- @davidsneighbour made their first contribution in #1013
- @dvelguru made their first contribution in #997
- @danieldiekmeier made their first contribution in #1024
- @anakinsleftleg made their first contribution in #1000
- @nextgenthemes made their first contribution in #1072
- @AdrianGonz97 made their first contribution in #1188
- @Gaelan made their first contribution in #1133
- @schnerring made their first contribution in #1216
- @vsn4ik made their first contribution in #1217
- @kempster made their first contribution in #1232
Full Changelog: v5.0.0...v6.0.0
v5.0.0
Bug Fixes
- add safelist variables to postcss-purgecss #840 (c822058)
- gulp-purgecss: support skippedContentGlobs option #853 (b72de77)
- Purgecss webpack plugin/only filter fix (#933) (f8e4c2c)
- purgecss-webpack-plugin: add sourcemap support #409 (b3f73ed)
- purgecss-webpack-plugin: export as named export as well as default (#821) (a6a2c8e)
- wrong path import (4f3ddd0)
Features
- add source map support #526 (f2a9c5a)
- gulp-purgecss: add support for gulp-sourcemaps #257 (55c26d2)
- postcss-purgecss: load options from purgecss config (4de3bd8)
- purgecss-webpack-plugin: load config file automatically #767 (726faaa)
BREAKING CHANGES
- purgecss-webpack-plugin: drop webpack 4 support
What's Changed (generated commit list minus dependabot)
- build(deps): update dependencies
- build(deps-dev): update dev dependencies
- fix(purgecss-webpack-plugin): export as named export as well as default by @G-Rath in #821
- Guide for Hugo by @zwbetz-gh in #918
- add github-actions to dependabot by @coliff in #934
- Purgecss webpack plugin/only filter fix by @mefu in #933
New Contributors
- @G-Rath made their first contribution in #821
- @zwbetz-gh made their first contribution in #918
- @mefu made their first contribution in #933
Full Changelog: v4.1.3...v5.0.0
v4.1.0
Bug Fixes
- Allow Absolute Paths (#679) (15335a2)
- css variable removed when declared in wrong order (89ece42), closes #518
- Fix interaction with other plugins (#647) (fb08e3a)
- grunt-purgecss: Fix plugin not ouputting all files (#723) (646e419)
- gulp-purgecss: fix support for stream input (fd5d3bf)
- Keep keyframe decimals for prefixed @keyframes (#749) (b804441)
- purgecss-from-pug: class attribute with multiple values not correctly handled with pug (#678) (ba6285d), closes #677
Features
- add dynamicAttributes option (2f9cc65)
- add option to ouput unused css (#763) (3a3d958)
- add purgecss-from-tsx (#716) (e556afc)
- export all types #780 (1a959c6)
- new purgecss-from-jsx plugin (#692) (3570c7d)
What's Changed
- Fix interaction with other plugins by @rluba in #647
- build(deps): [security] bump y18n from 4.0.0 to 4.0.1 by @dependabot-preview in #646
- Upgrade to GitHub-native Dependabot by @dependabot-preview in #658
- build(deps): [security] bump ssri from 6.0.1 to 6.0.2 by @dependabot-preview in #652
- build(deps-dev): bump ts-jest from 26.5.2 to 26.5.5 by @dependabot in #659
- build(deps-dev): bump lerna from 3.22.1 to 4.0.0 by @dependabot in #663
- build(deps-dev): bump @wessberg/rollup-plugin-ts from 1.3.8 to 1.3.14 by @dependabot in #661
- build(deps-dev): bump css-loader from 5.0.1 to 5.2.4 by @dependabot in #662
- build(deps-dev): bump eslint from 7.21.0 to 7.25.0 by @dependabot in #666
- build(deps-dev): bump typescript from 4.1.3 to 4.2.4 by @dependabot in #660
- build(deps-dev): bump @typescript-eslint/parser from 4.14.2 to 4.22.0 by @dependabot in #664
- build(deps-dev): bump @types/jest from 26.0.20 to 26.0.23 by @dependabot in #668
- build(deps-dev): bump @types/node from 14.14.31 to 15.0.1 by @dependabot in #665
- fix purgecss-from-pug not handle class attributes with multiple values correctly #677 by @Nauja in #678
- build(deps): bump lodash from 4.17.20 to 4.17.21 in /packages/grunt-purgecss by @dependabot in #672
- build(deps-dev): bump ts-node from 9.1.1 to 10.0.0 by @dependabot in #690
- fix: Allow Absolute Paths by @Subash in #679
- build(deps): bump lodash from 4.17.20 to 4.17.21 in /packages/purgecss-from-twig by @dependabot in #671
- build(deps-dev): bump mini-css-extract-plugin from 1.3.5 to 1.6.0 by @dependabot in #686
- build(deps-dev): bump lint-staged from 10.5.4 to 11.0.0 by @dependabot in #684
- build(deps-dev): bump eslint from 7.25.0 to 7.27.0 by @dependabot in #691
- build(deps-dev): bump typescript from 4.2.4 to 4.3.2 by @dependabot in #688
- build(deps-dev): bump rollup from 2.40.0 to 2.50.5 by @dependabot in #687
- build(deps-dev): bump ts-jest from 26.5.5 to 26.5.6 by @dependabot in #689
- build(deps): bump postcss-selector-parser from 6.0.4 to 6.0.6 by @dependabot in #685
- build(deps): bump webpack from 5.24.2 to 5.38.1 by @dependabot in #683
- build(deps-dev): bump pug-lexer from 5.0.0 to 5.0.1 by @dependabot in #682
- build(deps-dev): bump css-loader from 5.2.4 to 5.2.6 by @dependabot in #712
- build(deps): bump glob from 7.1.6 to 7.1.7 by @dependabot in #705
- new purgecss-from-jsx plugin by @Nauja in #692
- Add optional name for RawCSS option by @reboost in #703
- build(deps): bump postcss from 8.3.0 to 8.3.5 by @dependabot in #704
- build(deps-dev): bump grunt from 1.3.0 to 1.4.1 by @dependabot in #707
- new purgecss-from-tsx plugin by @Nauja in #716
- Add a step in CONTRIBUTING.md docs by @vnctaing in #722
- (grunt-purgecss): Fix plugin not ouputting all files by @vnctaing in #723
- build(deps-dev): bump @types/vinyl from 2.0.4 to 2.0.5 by @dependabot in #733
- build(deps): bump postcss from 8.3.5 to 8.3.6 by @dependabot in #726
- build(deps-dev): bump lint-staged from 11.0.0 to 11.1.1 by @dependabot in #724
- build(deps): bump webpack from 5.38.1 to 5.47.1 by @dependabot in #732
- build(deps-dev): bump @types/node from 16.0.0 to 16.4.10 by @dependabot in #731
- build(deps-dev): bump @types/glob from 7.1.3 to 7.1.4 by @dependabot in #730
- build(deps-dev): bump @typescript-eslint/parser from 4.28.2 to 4.28.5 by @dependabot in #727
- build(deps-dev): bump @types/parse5-htmlparser2-tree-adapter from 6.0.0 to 6.0.1 by @dependabot in #728
- build(deps): bump webpack-sources from 2.2.0 to 3.2.0 by @dependabot in #734
- build(deps-dev): bump mini-css-extract-plugin from 1.6.0 to 2.1.0 by @dependabot in #729
- build(deps): bump commander from 8.0.0 to 8.1.0 by @dependabot in #736
- build(deps-dev): bump ts-jest from 27.0.3 to 27.0.4 by @dependabot in #735
- build(deps-dev): bump css-loader from 5.2.6 to 6.2.0 by @dependabot in #737
- build(deps): bump webpack from 5.47.1 to 5.48.0 by @dependabot in #738
- build(deps): bump acorn-jsx from 5.3.1 to 5.3.2 by @dependabot in #739
- build(deps-dev): bump rollup from 2.52.8 to 2.55.1 by @dependabot in #743
- build(deps-dev): bump @types/grunt from 0.4.25 to 0.4.27 by @dependabot in #744
- build(deps-dev): bump @typescript-eslint/eslint-plugin from 4.28.2 to 4.29.0 by @dependabot in #742
- make it clear these are three mutually exclusive methods by @jjb in #745
- build(deps-dev): bump @typescript-eslint/parser from 4.28.5 to 4.29.0 by @dependabot in #740
- build(deps-dev): bump @types/parse5 from 6.0.0 to 6.0.1 by @dependabot in #741
- build(deps-dev): bump @typescript-eslint/eslint-plugin from 4.29.0 to 4.32.0 by @dependabot in #775
- Keep keyframe decimals for prefixed @Keyframes by @AdrianBannister in #749
- build(deps-dev): bump rollup from 2.55.1 to 2.58.0 by @dependabot in #772
- build(deps-dev): bump ts-node from 10.0.0 to 10.2.1 by @dependabot in #753
- build(deps): bump webpack from 5.48.0 to 5.61.0 by @dependabot in https://github.com/FullHuman/pur...
v4.0.0
v3.1.3
Changes
- postcss-purgecss remove postcss 8 as peer dependency
- purgecss-webpack-plugin fix backward compatibility with webpack 4
- PurgeCSS Update to PostCSS 8
- postcss-purgecss Add compatibility with PostCSS 8
- purgecss-webpack-plugin Fix deprecation warning with Webpack 5
Bug Fixes
v3.0.0
3.0.0
Simplifying whitelist option
Whitelist started as a simple option named whitelist
but grew up with the different use-cases and needs that appear with time. Another option called whitelistPatterns
appeared, then whitelistPatternsChildren
, …
It is now more complex and complicated, and somewhat difficult to remember how to use it with different options.
To summarize the changes, the whitelist options are now grouped in one option called safelist. And the most used options can be defined in one array.
Two forms are available. The simple form is:
safelist: ['invisibleClass', /^nav-/]
In this form, safelist is an array that can take a string or a regex.
The complex form is:
safelist: {
standard: ['invisibleClass', /^nav-/],
deep: [],
greedy: [],
keyframes: [],
variables: []
}
In this form, safelist is an object taking optional properties:
standard is the same as the simple form and replaces whitelist
and whitelistPatterns
deep replaces whitelistPatternsChildren
greedy is a new option coming from #424
keyframes can be used to add keyframes to the safelist, when using keyframes: true (#418)
variables can be used to add CSS variables to the safelist, when using variables: true
New Option: Blocklist
Blocklist will block the CSS selectors from appearing in the final output CSS. The selectors will be removed even when they are seen as used by PurgeCSS.
blocklist: ['usedClass', /^nav-/]
Even if nav-links
and usedClass
are found in your content files (HTML, Javascript), they will be removed.
CLI
PurgeCSS is using commander.js for its CLI. The recent version of commander.js introduced the possibility of making an option variadic. This means when specifying multiple option arguments, the parsed option value will be an array.
A few options are now taking advantage of this new feature: content, css, and the newly introduced option safelist and blocklist. It is no longer necessary to separate the list items with a comma.
From changelog:
v2.0
Changes:
- Asynchronous
import PurgeCSS from "purgecss";
const purgecssResults = await new PurgeCSS().purge({
// options
});
- Extractor is a function
content => content.match(/[\w-/:]+(?<!:)/g) || []
variables
option to remove unused CSS variables- Drop support of NodeJS < 8