Benjamin Oats Benjamin Oats - 1 year ago 167
CSS Question

Grunt postcss task exclude files

I am trying to set up

postcss grunt task
, i am wanting to run the task on all files in css/ except default.css, how do i exclude certain files?

This is my task

options: {
processors: [
dist: {
src: 'css/*.css',
exclude: 'css/default.css'



Answer Source

Somthing like:

    dist: {
        src: ['css/*.css', '!css/default.css']

should do the trick.

Have a read of the docs on grunt.file.match

Match one or more globbing patterns against one or more file paths. Returns a uniqued array of all file paths that match any of the specified globbing patterns. Both the patterns and filepaths argument can be a single string or array of strings. Paths matching patterns that begin with ! will be excluded from the returned array. Patterns are processed in order, so inclusion and exclusion order is significant.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download