I've started trying to get to grips with the very basics of Grunt but when I try to run 'Grunt Sass' I get a "No 'sass' targets found" error. I can't see where I'm going wrong, anyone able to give me nudge in the right direction?
module.exports = function(grunt) {
//configuration
grunt.initConfig({
// pass in options to plugins, references to files
concat: {
js: {
src: ['js/*.js'],
dest: 'build/script.js'
},
css: {
src: ['css/*.css'],
dest: 'build/styles.css'
},
sass: {
dist: {
files: [{
src: 'css/sass/styles.scss',
dest: 'css/styles.css'
}]
}
},
}
});
//Load Plugins
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-sass');
// register tasks
grunt.registerTask('concat-js', ['concat:js']);
grunt.registerTask('concat-css', ['concat:css']);
};
Your
sasstask is nested inconcatwhich is why it can’t identify thesasstask and is returning aNo "sass" targets found.error.Un-nest your
sasstask like such:Sidenote: Looks like your
csstask is misplaced as well, but that shouldn’t affectgrunt sassorgrunt sass:distfrom running; however, it will not findgrunt sass:css. If you want bothgrunt sass:cssandgrunt sass:distto be available, remove thecsstask fromjsand here’s how you should struct yoursasstask: