webpack-contrib / purifycss-webpack

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

Test with Vue.js and update README a little #115

Closed asmyshlyaev177 closed 6 years ago

asmyshlyaev177 commented 7 years ago

As CSS framework was used Bulma.io. Nothing seems to broken. I think this information can be helpfull for someone.

jsf-clabot commented 7 years ago

CLA assistant check
All committers have signed the CLA.

codecov[bot] commented 7 years ago

Codecov Report

Merging #115 into master will not change coverage. The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #115   +/-   ##
=======================================
  Coverage   67.07%   67.07%           
=======================================
  Files           5        5           
  Lines          82       82           
  Branches       29       29           
=======================================
  Hits           55       55           
  Misses         22       22           
  Partials        5        5

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update f223f30...a65176f. Read the comment docs.

maxmilton commented 6 years ago

@asmyshlyaev177 thanks for this, it gave me a good head start on incorporating purifycss into my vue projects. I've ended up with something like this:

build/webpack.prod.conf.js:

...

const fastGlob = require('fast-glob')

...

    // after ExtractTextPlugin

    // remove unused CSS
    new PurgecssPlugin({
      paths: fastGlob.sync([
        path.join(__dirname, '../index.html'),
        path.join(__dirname, '../src/**/*.vue'),
      ]),
      moduleExtensions: ['.vue'],
      // keyframes: true,
    }),

    // before OptimizeCSSPlugin

...
maxmilton commented 6 years ago

Crap, I just realised this is the repo for purifycss-webpack NOT purgecss-webpack-plugin... :sweat_smile:

FYI to anyone who finds this, purgecss-webpack-plugin is superior in that it actually works. I highly recommend using it instead: https://github.com/FullHuman/purgecss-webpack-plugin