Closed
Description
Describe the bug
It doesn't find the files any more.
To Reproduce
Steps to reproduce the behavior:
- Create a folder
dist
with a CSS file - Create a
.purgecss
file with the content as below - In the folder above, run
pcss --config ./.purgecss
Additional context
module.exports = {
content: ["dist/*.html", "dist/*.js"],
css: ["dist/*.css"],
output: "dist",
keyframes: true,
variables: true,
safelist: ["animate__animated", "animate__fadeOut", "animate__fadeIn", "text-white"],
}
I have purgecss
installed globally and aliased:
$ which pcss
/home/folk/.local/bin/pcss
$ file /home/folk/.local/bin/pcss
/home/folk/.local/bin/pcss: symbolic link to /home/folk/.npm-global/bin/purgecss
Results
ENOENT: no such file or directory, open 'undefined/index.065427ae.css'
ENOENT: no such file or directory, open 'undefined/index.505a1436.css'
Activity
folknor commentedon Nov 29, 2021
If I just run the command without using a
.purgecss
file, it works fine:fix: correct output for purgecss cli #802
Ffloriel commentedon Nov 29, 2021
The output directory was wrongly set for the CLI. This should be fixed in 4.1.3.
folknor commentedon Nov 29, 2021
Yes it works now :-) Another issue I just noticed now is that when I run the command 2 times it reduces the size further;
However, if I do
pnpm run css:purge
the second time, the size does not change. Is it because-con '["dist/*.html", "dist/*.js"]'
is invalid? I tried-con 'dist/*.html, dist/*.js'
as well and it also further reduces the size.Ffloriel commentedon Nov 29, 2021
Yes, it looks like the format is incorrect for --con. It should be
--con dist/*.html dist/*.js