2

I have installed grunt and trying the grunt-react and grunt-contrib-imagemin tasks. I have setup the following Gruntfile.js.

module.exports = function(grunt) {

  grunt.initConfig ({
    imagemin: {
      dynamic: {
        files: [{
          expand: true,
          cwd: 'public',
          src: ['development/images/*.{png,jpg,gif}'],
          dest: 'images'
        }],
        options: {
          cache: false
        }
      }
    },
    react: {
      single_file_output: {
        files: {
          'bundle.jsx': 'login.jsx'
        }
      }
    }
  });

  grunt.loadNpmTasks('grunt-contrib-imagemin');
  grunt.loadNpmTasks('grunt-react');

  grunt.registerTask('imagemin', ['imagemin']);
  grunt.registerTask('react', ['react']);
};

From the command line, I start the tasks as grunt react or grunt imagemin. After passing a --verbose CLI flag, Grunt reports that all checks were OK. Yet both the tasks runs indefinitely. They never end. Please help me.

Here is my Grunt version info:

grunt-cli v0.1.13
grunt v0.4.5

Here is the command line output:

Running "react" task

This is repeatedly printed with the --verbose flag.

psiyumm
  • 6,437
  • 3
  • 29
  • 50
  • You have to change 'bundle.jsx' to 'bundle.js', I am not sure if it fixes your problem, but the output for the react task is a javascript file. – Mario Araque Jun 05 '15 at 07:58
  • @MarioAraque thank you for pointing that out. Though not a concern because extensions don't matter. Just for usability and I agree with your recommendation. – psiyumm Jun 05 '15 at 08:08

1 Answers1

2

I was able to get it work, by changing the following:

grunt.registerTask('reactify', ['react']);

I changed the name of the tasks. I think due to a cyclic nature of the internal design, it causes indefinite execution.

psiyumm
  • 6,437
  • 3
  • 29
  • 50