我正在涉足Grunt。我试图写一个任务autoprefix自动我的CSS。Grunt autoprefixer不加前缀
这里是我的Gruntfile
module.exports = function(grunt) {
'use strict';
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
autoprefixer: {
options: {
browsers: ['last 8 versions']
},
files: {
'css/styles.css': 'css/styles.css'
}
},
watch: {
sass: {
files: ['sass/**/*.{scss,sass}','sass/_partials/**/*.{scss,sass}'],
tasks: ['sass:dist', 'autoprefixer']
},
livereload: {
files: ['*.html', '*.php', 'js/**/*.{js,json}', 'css/*.css','img/**/*.{png,jpg,jpeg,gif,webp,svg}'],
options: {
livereload: true
}
}
},
sass: {
dist: {
files: {
'css/styles.css': 'sass/styles.scss'
}
}
}
});
grunt.registerTask('default', ['sass:dist', 'autoprefixer', 'watch']);
grunt.loadNpmTasks('grunt-sass');
grunt.loadNpmTasks('grunt-autoprefixer');
grunt.loadNpmTasks('grunt-contrib-watch');
};
当我运行的呼噜声,它说,它的运行任务的很好,但是当我检查CSS文件,没有被处理。
我错过了什么? (答案是肯定的,但我想知道什么:))
它不应该是不够的,只是针对src和没有文件? – maverick