-
-
Notifications
You must be signed in to change notification settings - Fork 244
Description
Describe the bug
While I still feel like I am the one doing something wrong here, I feel like I have exhausted all possible error sources on my end:
I am trying to run PurgeCSS via the CLI using the following config file:
// purgecss.config.js
console.log("Using purgecss.config.js");
module.exports = {
content: ["index.html"],
css: ["style.css"],
};
The directory structure of my project directory is as follows:
index.html
node_modules/
package-lock.json
package.json
purgecss.config.js
style.css
When I run PurgeCSS with the following command without the config file it works as expected:
purgecss --content index.html --css style.css --output style.purged.css
However, when I try to run it with the config file, I only get the output from the console.log but my CSS isn’t being processed:
purgecss --config ./purgecss.config.js --output style.purged.css
I assume there’s something wrong with my config file but I can’t figure out what exactly.
To Reproduce
- Run
purgecss --content index.html --css style.css --output style.purged.css - File
style.purged.cssis created - Delete
style.purged.css - Run
purgecss --config ./purgecss.config.js --output style.purged.css Using purgecss.config.jslogged to console butstyle.purged.cssis not being created
Expected Behavior
I would expect running PurgeCSS using the config file to give me the same result as running it without, i.e. create a new file style.purged.css in my project directory containing the purged CSS. I need to be able to run PurgeCSS with a config file because I rely on being able to define a custom extractor.
Environment
macOS 15.3
purgecss 7.0.2
node 20.11.1
Add any other context about the problem here
No response
Code of Conduct
- I agree to follow this project's Code of Conduct