Home

Issue: 892

Help cleanup css unused styles mess with a webpack plugin

[issue link]

I am new to nuxt and really enjoying working with it so far. I created a simple app with few pages and deploying on zeit/now. All I have done is added firebase and bulma/scss and I have started getting chunk size warnings! So I went looking and I think I have reduced my firebase footprint but not happy with amount of unused CSS styling being shipped to the browser. I have selectively imported only relevant scss files in layout, however there are still many styles that are not used but get bundled.

So I started looking and found that PurifyCSS with purifycss-webpack is the answer. Then I looked for ways to include the plugin in build, so I tried below in nuxt.config.js:

...
build: {
    plugins: [
      new PurifyCSSPlugin({paths: glob.sync(path.join(__dirname, 'index.html'))})
    ]
}
...

I still see that my index.html is loaded with unused styles in dev.

What am I missing?

This feature request is available on Nuxt.js community (#c765)