Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript Grunt Help

  • This topic is empty.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #166178
    SilverSerpent
    Participant

    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!

    #166182
    SilverSerpent
    Participant

    Yes I am. So is the only solution to remove that from my Gruntfile?

    #166186
    SilverSerpent
    Participant

    Ok thanks!

    1. Will look!
    2. That might take quite a bit of learning haha
    3. I have one but I wanted/needed a Windows machine too for school :D
Viewing 3 posts - 1 through 3 (of 3 total)
  • The forum ‘JavaScript’ is closed to new topics and replies.