Grunt task to combine CSS files by @include instruction
. Compress CSS files.
. Combine files via @include
. npm install grunt-css-include-combine -l
This plugin requires Grunt
If you haven't used Grunt before, be sure to check out the Getting Started guide, as it explains how to create a Gruntfile as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:
npm install grunt-contrib-cssmin --save-dev
Create a main CSS file with your include's instructions, like:
Then, on your Gruntfile:
gruntinitConfig'css-include-combine':'libs':// include's on CSS will use this PATH as it's relative// path. This also is applied to resources url's.relativeDir: 'path'// your main file (see example above)main: 'libsDependencies.css'// the generated fileout: '3rdPartyLibs.css';gruntloadNpmTasks'grunt-css-include-combine';
By typing on command line the following will generate the 3rd party libs minified file. If you want to add more file just edit the CSS main file and run Grunt!