Skip to content Skip to sidebar Skip to footer

Grunt Expand Files, What Patterns Are Acceptable In Src?

Snippet from gruntfile.js sass: { compile: { files: [{ expand: true, cwd: 'css/', src: ['^[^_].scss'], dest: '../css/',

Solution 1:

Try this pattern: ['*.scss', '!_*.scss']. It'll make the distinction more explicit, too.

sass: {
    compile: {
        files: [{
            expand: true,
            cwd: 'css/',
            src: ['*.scss', '!_*.scss'],
            dest: '../css/',
            ext: '.css'
        }]
    }
},

If you want to match recursively (files in subfolders of cwd), use **/*

sass: {
    compile: {
        files: [{
            expand: true,
            cwd: 'css/',
            src: ['**/*.scss', '!**/_*.scss'],
            dest: '../css/',
            ext: '.css'
        }]
    }
},

Learn more about Grunt Globbing Patterns, which aren't the same as regular expressions.

Post a Comment for "Grunt Expand Files, What Patterns Are Acceptable In Src?"