Purge plugin for PG available! Fixed, I think!

EDIT: I think we are working on all platforms!!
No plans ever suffer the heat of battle! I thought I had tested well enough, but as it turns out I didn’t understand how Pinegrow handles files well enough. I fell back to straight Node.js and NW.js and things seem to be working on Mac, PC, and Linux. I’ve tried to test as much as possible, but there is still the possibility you will have the one circumstance I didn’t test/make-work arounds for! That being said, the plugin page is back. It is with great humility that I apologize for time wasted.

EDIT: Nope - fixed for some, but not all operating systems. For some reason I think that the Node.js file creation is failing on some operating systems. Trying to get fixed quickly!

EDIT: My apologies for the (too) early release of my free plugin below. All fixed now! (At least I think it is.)

As it turns out, it wasn’t something I stripped out before archiving! I forgot to convert URL names back to file names, so anytime there was a space in a folder or filename it would choke. In my testing I didn’t hit upon this before release.

EDIT: Ahhhhh - I stripped some development files out before compressing and uploading and broke the plugin. I’ll get a new working version up soon. Soory all. Serves me right for trying to get the plugin out after a looooong day.

I’ve put out a new free plugin that I think many people here on the forum will find useful. In other threads I’ve seen people unhappy with the size of the CSS files used for a number of Frameworks. Well, now you can Purge It!

First, the disclaimer! The plugin hasn’t been tested nearly as much as it should probably, but I don’t think there are any major bugs. It should do what it says, but there may be cases when it doesn’t perform as well as expected.

So, what is it! Well, this new plugin implements the PurgeCSS JavaScript library within Pinegrow. It allows you to run all of your HTML and CSS files through the library to output a single CSS file that contains only the rules that have been used in your project. Slim that Bootstrap.css file down before minifying it! Say “No!” to huge Tailwind CSS styling files.

Hope everyone enjoys and gives feedback!

YouTube video - watch at high speed- I’m a bit sloth-like this morning! https://www.youtube.com/watch?v=tlL8U6mJzCs

https://plugins.springhilldesign.net/purge-plugin-for-pinegrow/

8 Likes

Nice! Going to try it soon!

Warm Regards & Thanks a lot!

David

1 Like

@RobM Thanks! Plugin Master, King of the plugins! :heart_eyes:
Interesting and powerful addition. Really nice to have this feature inside Pinegrow.
:heart::evergreen_tree:

1 Like

hey Rob, thanks for the plugin and all the hard work and time your giving in for the community

1 Like

STATUS: @RobM :> UPGRADE :> Godlike

This has been soooo needed for so long!
Not just for Pinegrow, but an easy imlementation within ANY app that uses these behemoth style libraries.

Luckily for us, we have you AND Pinegrow App!

If/when I finish this sewing my fingers to things in the not to remote future, I’m so looking forward to trying this out.

At last!
Cheers

1 Like

Hi Bob,
Try to download your new plugin, but unfortunately is the web page with the plugin gone! :wink:
Regards,
David

1 Like

Hey David - if you look through the flurry of edits at the top of the post you’ll see that I didn’t take proper account of how Windows and Mac file systems differ. path.normalize is your friend. At any point, I had deactivated the download page when I realized there were problems. It is back live now. I hope there are no problems. I’m a bit frazzled with all of the trouble-shooting and cross-platform testing!
Cheers,
Bob

2 Likes

Awesome work. No apologies needed, you’ve dedicated your time and also made it free at your own expense. Thank you and it is much appreciated.

2 Likes

Hi Bob,
Working great! Thanks again!
Would it be possible to add multiple folders loading and html from different folders in the future?
Because we use multi language websites with 4 languages and non uniform styling for every language.
Regards,
David :wink:

I guess I could add multiple input fields for both the HTML and CSS. I guess it wouldn’t be that tough.

1 Like

Hi Bob,
great work with the plugin. One thing I wanted to ask. Does the plugin also work when using wordpress, because I tried it and it broke my page, a part of the bootstrap styling.

So the PurgeCSS JavaScript should go through any template files that you input and compare all of the found classes and ids to the styling rules. So, it should work, but I don’t think I enabled *.php files. Were you able to select them for scanning? I haven’t looked at the library close enough to se if it would choke on non-HTML files.

Hi Rob, Fantastic! Thanks a lot for sharing this with the rest of us. I tried it last night on a 4 pages site and it brought down my style.css from 28KB to 12KB.
Now what is the best practice to apply/replace my before purged style.css file. Rename it style.css.old and rename the purge.css file to style.css and drop it to the canvas?
Many Many Thanks for this plug in!

I’m not completely sure what best practice would be, but that is the way I would do it :slight_smile:. As long as you don’t get rid of the old style sheets in order to recover if something went wrong that you don’t discover until later.
Cheers,
Bob

1 Like

Pinegrow Web Editor - 5.971 - error when adding the plugin.

Error message when selecting the CSS folder.

Hi @mhigaki,
I look into this today. What OS are you running?
Bob

Hi @mhigaki - thanks again for bringing this to my attention. It turns out this is also a breaking update for the Purify plugin. :frowning:
I don’t see anything in the nw.js or node changelogs that explain this change in behavior.

|Description:|Ubuntu 20.04.1 LTS|
|Release:|20.04|
|Codename:|focal|

Thanks,
I think it has been fixed for the update. I’ll post later.

A new version of the Purge plugin has been posted. You can go to the plugins page and download it. Fair warning, it does not work with the local CSS file for TailwindCSS. Pinegrow loads in Tailwind through a CDN, so it doesn’t really matter, but if anybody is using the local file version, it won’t work. I’m modifying the Purify plugin so that it will.

2 Likes