1

我有一些 grunt 任务正在运行,包括grunt-autoprefixer。所有任务都在正常运行,autoprefixer 任务也是如此。但是我的 css 规则中没有添加任何前缀。我想念/误解什么?我的 Gruntfile 选项:

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

然后我运行grunt.loadNpmTasks('grunt-autoprefixer'); grunt.registerTask('default', ['uglify', 'sass', 'autoprefixer', 'watch']); And 正如我提到的那样,到目前为止没有任何错误。4 个源文件在我的 cssDir 中,控制台也显示 4 个文件已处理

可以加前缀的 CSS 规则:例如box-shadow, border-radius, linear-gradient

但是在我的 css 文件中没有进行任何更改,没有添加前缀。帮助?:-)

4

1 回答 1

0

您可以尝试一下并确保globalConfig.cssDir变量设置正确:

autoprefixer: {
    options: {
        browsers: ['ie > 7', 'ff > 3.4'] //just to test task
    },
    multiple_files: {
        src: '<%= globalConfig.cssDir %>/*.css',
        dest: '<%= globalConfig.cssDir %>/'
    }
}
于 2014-04-22T13:07:34.037 回答