How to do it...

  1. This recipe requires us to add an additional Grunt plugin. Thus, open your console, navigate to chapter9/start/grunt/, and run the npm install grunt-uncss --save-dev command.
  2. Next, from your text editor, navigate to chapter9/start/grunt and open the package.json file. Verify that the command issued in the first step of this recipe has added this line of code at the bottom of the devDependencies section:
"grunt-uncss": "^0.6.1"
  1. While still in the grunt folder, we will add a new task to our Gruntfile.js starting from line 45:
 // Remove CSS that is not used uncss: { dist: { files: [ { src: '../app/www/*.html', dest: '../app/www/css/main.css'} ] }, options: { compress: true } },
  1. We also need to load the grunt-uncss plugin, ...

Get Bootstrap 4 Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.