0

When I do a 'grunt serve' in my terminal it just sits and watches. it never opens my browser. I'm not sure what I am missing.

Take a look at this and tell me what I am doing wrong:

module.exports = function(grunt) {

  // Project configuration.
  grunt.initConfig({
    pkg: grunt.file.readJSON('package.json'),
    uglify: {
      options: {
        banner: '/*! <%= pkg.name %> <%= grunt.template.today("yyyy-mm-dd") %> */\n'
      },
      build: {
        src: 'src/<%= pkg.name %>.js',
        dest: 'build/<%= pkg.name %>.min.js'
      },
      my_target: {
          files: {
            'js/min/main.min.js': ['js/main.js'],
            'js/min/libs.min.js': ['bower_components/jquery/dist/jquery.min.js','bower_components/bootstrap/dist/js/bootstrap.min.js']
          }
        }
    },
    compass: {
        dist: {
          options: {
            config: 'config.rb',  // css_dir = 'dev/css'
            sassDir: 'sass',
            cssDir: 'css',
          }
        }
    },
    watch: {
        all: {
            files: '**/*',
            options: {
                livereload: true
            },
        }
    },
    connect: {
       server: {
          options: {
            port: 8000,
            hostname: 'localhost',
          }
      }
    }

  });



  // Load the plugin that provides the "uglify" task.
  grunt.loadNpmTasks('grunt-contrib-watch');
  grunt.loadNpmTasks('grunt-contrib-compass');
  grunt.loadNpmTasks('grunt-contrib-uglify');
  grunt.loadNpmTasks('grunt-contrib-connect');
  grunt.loadNpmTasks('grunt-serve');

  // Default task(s).
  grunt.registerTask('build', ['uglify','compass']);
  grunt.registerTask('server', [
    'uglify',
    'compass',
    'watch',
    'connect'
    ]);

};
Satyam Koyani
  • 4,236
  • 2
  • 22
  • 48
John
  • 107
  • 2
  • 12
  • You have configured 'server' command. Are you running grunt server or grunt serve? Asking because in question title you mentioned serve. – Satyam Koyani Mar 31 '15 at 02:55
  • I am not sure what the difference is between the 'server' and 'serve' my task is 'grunt-serve' so I imagine its 'serve'. I don't care what it is I just want it to popup in a brower when i run the command. – John Mar 31 '15 at 12:52
  • I know that very well but here as you are saying that you are running serve task but serve task is not configured in your grunt config file. – Satyam Koyani Apr 01 '15 at 09:10

0 Answers0