webpack-contrib / purifycss-webpack

UNMAINTAINED, use https://github.com/FullHuman/purgecss-webpack-plugin
MIT License
772 stars 37 forks source link

Removing used css #62

Open chopfitzroy opened 7 years ago

chopfitzroy commented 7 years ago

So I have the following css:

body {
  display: -ms-flexbox;
  display: flex;
  background-color: deeppink; }
  body div {
    background-color: deepskyblue; }

p {
  background-color: lime; }

Which after purifying is looking like this:

body {
  display: -ms-flexbox;
  display: flex;
  background-color: deeppink;
}

p {
  background-color: lime;
}

I am running with webpack 2 with the following options:

new Purify({
        basePath: __dirname,
        paths: ['index.html']
})
bebraw commented 7 years ago

Can you set up a standalone project? I can't reproduce this.

chopfitzroy commented 7 years ago

Hey @bebraw yep will do as soon as I am off work.

chopfitzroy commented 7 years ago

Hey @bebraw sorry have had a hectic last few days but planning to get onto this over the weekend.

Cheers.

Chrischuck commented 7 years ago

I'm having a similar issue where all my css(using bootstrap 3 and inline styles for react) are getting wiped. Purify says 40.6% of my css has been reduced, so theres still css, but the ones I use get tossed out.

These are my plugins

screen shot 2017-01-14 at 2 02 48 pm

My file structure

screen shot 2017-01-14 at 2 03 16 pm

Best Regards, Chris

bebraw commented 7 years ago

@Chrischuck It's important to point your app source to Purify assuming you have something class related going on there. So it may be a matter of tweaking paths.

Note that I have a new version of the plugin coming up once either npm or @IngwiePhoenix grants me the rights to publish one.

bebraw commented 7 years ago

There's a new version now. Please give that a go.

Chrischuck commented 7 years ago

Sorry for the late reply, I've been busy lately. I will give it a go when I get the chance!

chopfitzroy commented 7 years ago

Hey @bebraw perfect fixed my issues :) sorry it took sooo long to get back to you have been slammed, will leave open until @Chrischuck can confirm.