purgecss icon indicating copy to clipboard operation
purgecss copied to clipboard

Error running on Win 10

Open jaygray0919 opened this issue 1 year ago • 1 comments

Describe the bug

Having some difficulty with purgecss. I am running Win10 with the following infrastructure:

node (v18.20.4)
npm (10.7.0)
purgecss (6.0.0)

my purgecss.config.js looks like this:

const purgecssFromHtml = require('purgecss-from-html');

module.exports = {
  content: ['./index.html'],
  css: ['./src/css/empty.css'],
  extractors: [
    {
      extractor: purgecssFromHtml,
      extensions: ['html'],
    },
  ],
  output: './output',
};

my project is organized like this:

project-directory/
│
├── index.html
├── purgecss.config.js
├── src/
│   └── css/
│       └── empty.css
└── output/

All CSS is inline for index.html empty.css is empty

this command npx purgecss --config ./purgecss.config.js does not generate a file in the output directory

these terminal commands also fail: npx purgecss --content ./index.html --css ./src/css/empty.css --output ./output npx purgecss --content ./index.html --output ./output

what am I doing wrong?

Thanks for assistance here.

To Reproduce

steps

Expected Behavior

expected behavior

Environment

Win 10 node (v18.20.4) npm (10.7.0) purgecss (6.0.0)

Add any other context about the problem here

context

Code of Conduct

  • [X] I agree to follow this project's Code of Conduct

jaygray0919 avatar Sep 28 '24 19:09 jaygray0919

Update. have successfully run this terminal command npx purgecss --content ./index.html --css ./src/css/styles.css --output ./output however, had to change ./output directory structure to match ./src directory structure

using new directory structure, this command now works: npx purgecss --config ./purgecss.config.js with this argument: output: './output', not an argument that follows the ./src directory structure

however, HTML inline CSS process still fails

but fall back to moving inline to an external file works, so will follow that process in the future

jaygray0919 avatar Sep 29 '24 16:09 jaygray0919

Yes, PurgeCSS will not purged the inline CSS from an HTML out of the box.

Ffloriel avatar Nov 12 '24 15:11 Ffloriel