question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

multiple html files

See original GitHub issue

I need purge a css file which have styles for multiple htmls, I have this script in my package.json:

"scripts":{
...
"postbuild": "purgecss --css build/styles/*.css --content build/*.html build/scripts/*.js --output build/styles"
....
}

but this only take the first file styles and the others are removed

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:3
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

4reactions
joneldiablocommented, Apr 14, 2020

when I use the flag --content with a wildcard like --content build/*.html purgecss just purge the css for the first html. example:

index1.html:

<div class="class1"></div>

index2.html:

<div class="class2"></div>

both files have link to one file like this:

.class1{...}
.class2{...}
.class3{...}
.class4{...}

the output only have:

.class1{....}

spected:

.class1{....}
.class2{....}
3reactions
Fflorielcommented, Apr 29, 2020

The documentation was not updated to reflect the changes. The list of files should be comma separated.

purgecss --css build/styles/*.css --content build/*.html build/scripts/*.js --output build/styles

should be

purgecss --css build/styles/*.css --content build/*.html,build/scripts/*.js --output build/styles

and

purgecss --config purgecss.config.js --css tailwind_styles.css --content options.js frame.js --output ./out/

should be

purgecss --config purgecss.config.js --css tailwind_styles.css --content options.js,frame.js --output ./out/
Read more comments on GitHub >

github_iconTop Results From Across the Web

Multi-Page HTML Sites - LearnHowToProgram.com
As you know, many websites feature multiple pages. Different areas you can navigate between (usually with links, or a navigation menu) to see...
Read more >
HTML input multiple Attribute - W3Schools
The multiple attribute is a boolean attribute. When present, it specifies that the user is allowed to enter more than one value in...
Read more >
Is it more efficient to have multiple HTML files or just one big ...
The answer is no, it is not efficient to have only one big HTML file compared to 7 smaller files.
Read more >
When does a website require multiple HTML files (JavaScript ...
I would say when need multiple pages. For example; About page, Services page, Contact page etc. Then you would create a separate HTML...
Read more >
How to create multiple pages in HTML - Coderslang
How to create multiple pages in HTML · Step 1: Create a folder. The first step is to add a folder. · Step...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found