nDmitry / grunt-autoprefixer

Parse CSS and add vendor-prefixed CSS properties using the Can I Use database. Based on Autoprefixer.
MIT License
795 stars 60 forks source link

Autoprefixer and Grunt Multi Task format support? #114

Closed oller closed 9 years ago

oller commented 9 years ago

Hi there,

I'm just trying to use the grunt multi task pattern, so I can invoke mulitple tasks with different arguments through autoprefixer

autoprefixer: {
    standards: {
        options: {
            browsers: ['last 3 versions', '> 1%', 'ie >= 10', 'ff >= 26'],
            diff: true
        },
        apply: {
            src: '<%= app.css %>/app.css'
        }
    },
    ie9: {
        options: {
            browsers: ['ie 9'],
            diff: true
        },
        apply: {
            src: '<%= app.css %>/app-ie-9*.css'
        }
    },
    ie8: {
        options: {
            browsers: ['ie 8'],
            diff: true
        },
        apply: {
            src: '<%= app.css %>/app-ie-8.css'
        }
    }
},

However this generates no output:

$ grunt autoprefixer

Running "autoprefixer:standards" (autoprefixer) task

Running "autoprefixer:ie9" (autoprefixer) task

Running "autoprefixer:ie8" (autoprefixer) task

Done, without errors.

If i remove the nesting of tasks and just run the standards tasks like so, it executes fine - so there's nothing wrong with my paths.

autoprefixer: {
    options: {
        browsers: ['last 3 versions', '> 1%', 'ie >= 10', 'ff >= 26'],
        diff: true
    },
    apply: {
        src: '<%= app.css %>/app.css'
    }
},

Any ideas what I'm missing?

Many thanks!

oller commented 9 years ago

Aha, I shouldn't be nesting files src so much...

autoprefixer: {
    standards: {
        options: {
            browsers: ['last 3 versions', '> 1%', 'ie >= 10', 'ff >= 26'],
            diff: true
        },
        src: '<%= app.css %>/app.css'
    },
    ie9: {
        options: {
            browsers: ['ie 9'],
            diff: true
        },
        src: '<%= app.css %>/app-ie-9*.css'

    },
    ie8: {
        options: {
            browsers: ['ie 8'],
            diff: true
        },
        src: '<%= app.css %>/app-ie-8.css'
    }
},