#7 — related issue. @Ffloriel, ping.
1. Summary
Any PurgeCSS whitelisting options doesn't work for me.
2. Data
2.1. Environment
-
Operating system:
- Windows 10 Enterprise LTSB 64-bit EN — local
- Ubuntu 14.04.5 LTS
-
Node.js 11.10.0
-
purgecss 1.1.0
-
grunt 1.0.3
-
grunt-purgecss 1.1.0
-
grunt-cli 1.3.2
3. Files
Look at KiraPurgeCSS branch of my demo repository:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>PurgeCSS debugging</title>
</head>
<body>
<p class="KiraFirst">Kira</p>
</body>
</html>
.KiraFirst {
color: red
}
.KiraSecond {
color: yellow
}
module.exports = (grunt) ->
grunt.initConfig
purgecss:
options:
content: ["KiraGoddess.html"]
whitelist: [".KiraSecond"]
whitelistPatterns: [/\.KiraSecond/g]
whitelistPatternsChildren: [/\.KiraSecond/g]
main:
files:
"KiraGoddess.css": ["KiraGoddess.css"]
grunt.loadNpmTasks 'grunt-purgecss'
return
4. Steps to reproduce
4.1. PurgeCSS CLI
purgecss --css KiraGoddess.css --con KiraGoddess.html --out . --whitelist KiraSecond
4.2. grunt-purgecss
5. Behavior
5.1. Expected — CLI
.KiraFirst {
color: red
}
.KiraSecond {
color: yellow
}
purgecss-CLI successful ignore .KiraSecond class.
5.2. Unexpected — Grunt
.KiraFirst {
color: red
}
grunt-purgecss not ignore .KiraSecond class.
Note, how Grunt show options:
Options: content=["KiraGoddess.html"], whitelist=[".KiraSecond"], whitelistPatterns=[{}], whitelistPatternsChildren=[{}]
6. Not helped
- Remove
\. and /g from patterns
- Adding
^ and $ to regexes as in example
Thanks.
#7 — related issue. @Ffloriel, ping.
1. Summary
Any PurgeCSS whitelisting options doesn't work for me.
2. Data
2.1. Environment
Operating system:
Node.js 11.10.0
purgecss 1.1.0
grunt 1.0.3
grunt-purgecss 1.1.0
grunt-cli 1.3.2
3. Files
Look at KiraPurgeCSS branch of my demo repository:
KiraGoddess.html:KiraGoddess.css:Gruntfile.coffee:4. Steps to reproduce
4.1. PurgeCSS CLI
4.2. grunt-purgecss
5. Behavior
5.1. Expected — CLI
Live demo on Travis CI
Result:
purgecss-CLI successful ignore
.KiraSecondclass.5.2. Unexpected — Grunt
Live demo on Travis CI
Result:
grunt-purgecss not ignore
.KiraSecondclass.Note, how Grunt show options:
6. Not helped
\.and/gfrom patterns^and$to regexes as in exampleThanks.