- This topic is empty.
Viewing 3 posts - 1 through 3 (of 3 total)
Viewing 3 posts - 1 through 3 (of 3 total)
- The forum ‘JavaScript’ is closed to new topics and replies.
The forums ran from 2008-2020 and are now closed and viewable here as an archive.
Home › Forums › JavaScript › Grunt Help
I am having a kind of confusing problem following Chris’s Grunt tutorial on 24ways. Here is my current Gruntfile:
module.exports = function(grunt) {
grunt.initConfig({
sass: {
dist: {
options: {
style: 'expanded'
},
files: {
'css/build/main.css': 'css/main.scss'
}
}
},
imagemin: {
dynamic: {
files: [{
expand: true,
cwd: 'images/',
src: ['**/*.{png,jpg,gif}'],
dest: 'images/build/'
}]
}
},
watch: {
sass: {
files: ['css/*.scss'],
tasks: ['sass']
}
}
});
grunt.loadNpmTasks('grunt-contrib-sass');
grunt.loadNpmTasks('grunt-contrib-imagemin');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.registerTask('default', ['sass', 'imagemin', 'watch']);
}
When I run this as it is, it runs the sass
task and then the imagemin
task, but quits without ever running the watch
task. However, it I remove imagemin
from the registerTask
function, then the sass
and watch
tasks both run fine. Any ideas? Thanks!
Yes I am. So is the only solution to remove that from my Gruntfile?
Ok thanks!