I am new to Grunt. I thought I would try, so I created this grunt file.
module.exports = function(grunt) { grunt.initConfig({ pkg: grunt.file.readJSON('package.json'), concat: { css: { src: [ './css/*' ], dest: './css/all.css' }, js: { src: [ './js/*' ], dest: './js/all.js' } }, uglify: { js: { files: { './js/build/all.min.js': ['./js/all.js'] } } }, sass: { build: { files: [{ expand: true, cwd: './css/sass', src: ['*.scss'], dest: './css', ext: '.css' }] } }, cssmin: { css: { src: './css/all.css', dest: './css/build/all.min.css' } }, watch: { files: ['./css/sass/*', './js/*'], tasks: ['sass:build','concat:css', 'cssmin:css', 'concat:js', 'uglify:js'] } }); grunt.loadNpmTasks('grunt-contrib-uglify'); grunt.loadNpmTasks('grunt-contrib-watch'); grunt.loadNpmTasks('grunt-contrib-sass'); grunt.loadNpmTasks('grunt-contrib-cssmin'); grunt.loadNpmTasks('grunt-contrib-concat'); grunt.registerTask('dev', ['sass:build','concat:css', 'cssmin:css', 'concat:js', 'uglify:js']); };
When I run "grunt watch" and make changes to the .scss file, the terminal complains and then aborts.
Running "watch" task Waiting... >> File "css/sass/all.scss" changed. Running "sass:build" (sass) task File css/all.css created. Running "concat:css" (concat) task Warning: Unable to read "./css/build" file (Error code: EISDIR). Use --force to continue. Aborted due to warnings. Completed in 1.276s at Thu May 01 2014 23:53:59 GMT+0100 (BST) - Waiting...
Please can someone please indicate where I am mistaken?
It looks like concat:css - but there is no link to the assembly directory.
I believe that this may be due to the fact that some tasks collide, and the files are not yet ready to work, perhaps? Is there a job order?
Please carry me like everything new!
Thanks Michael.
sass gruntjs
Michael Giovanni Pumo
source share