I have a few grunt tasks running, including grunt-autoprefixer. All tasks are running without errors, so is the autoprefixer task. But there are no prefixes added to my css rules. What do I miss / misunderstand? My Gruntfile options:

autoprefixer: {
    options: {
      browsers: ['ie > 7', 'ff > 3.4'] //just to test task
    },
    src: '<%= globalConfig.cssDir %>/*.css',
    dest: '<%= globalConfig.cssDir %>/*.css'
},

Then I run grunt.loadNpmTasks('grunt-autoprefixer'); grunt.registerTask('default', ['uglify', 'sass', 'autoprefixer', 'watch']); And as I mentioned without any Errors - so far. 4 sourcefiles are in my cssDir and console also shows 4 files processed

CSS rules which could be prefixed: e.g. box-shadow, border-radius, linear-gradient

But no changes are made in my css files not prefixes added. Help? :-)

有帮助吗?

解决方案

Can you try that and also make sure globalConfig.cssDir variable is set correctly:

autoprefixer: {
    options: {
        browsers: ['ie > 7', 'ff > 3.4'] //just to test task
    },
    multiple_files: {
        src: '<%= globalConfig.cssDir %>/*.css',
        dest: '<%= globalConfig.cssDir %>/'
    }
}
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top